feat(linter): Adapter for docformatter#129
Conversation
|
Could you create an example in https://github.com/justinchuby/lintrunner-adapters/tree/main/examples/adapters thanks! |
e746917 to
c002ba8
Compare
|
Thank you for the comment @justinchuby! Please have another look when you have time 😄 |
c002ba8 to
ba9d44d
Compare
ba9d44d to
737909f
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new adapter for docformatter, a Python docstring formatter, to the lintrunner_adapters collection. The implementation follows the general structure of other formatters in the codebase but has several deviations from established patterns that should be addressed.
- Implements a docformatter adapter with configuration support
- Uses docformatter's
--diffoutput with thepatchcommand to obtain reformatted code - Includes an example lintrunner configuration file
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| lintrunner_adapters/adapters/docformatter_linter.py | New adapter implementation for docformatter with check_file and main functions, includes multi-threaded execution support |
| examples/adapters/docformatter_linter/.lintrunner.toml | Example configuration file demonstrating docformatter integration with lintrunner |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Could you check the copilot comments and ensure consistency with the other linter adapters? Thanks |
|
Hello @justinchuby, I hope you enjoyed the holidays! Just wanted to check if you're happy with the changes I've made? |
|
Thanks for the reminder! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Using docformatter with stdin results in the replacement being output "raw" to stdout. This is perfect since the raw output is exactly what we want "replacement" to be. This changes errors handling as the return code is now always 0, regardless of if there was a change or not. Also add error handling for decoding utf-8.
|
Thanks for updating! I’m glad you found a way to return the whole file. |
|
@Sebastian-Larsson do you plan to make additional changes, or would you like me to make a release? |
|
@justinchuby we're planning on making at least one more contribution. I think that PR should come up this week. So you can hold off and wait for that if you'd like! |
Adapter for https://github.com/PyCQA/docformatter.