Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Code Climate reporting format #418

Open
tribals opened this issue Jan 26, 2019 · 7 comments
Open

Support for Code Climate reporting format #418

tribals opened this issue Jan 26, 2019 · 7 comments

Comments

@tribals
Copy link

tribals commented Jan 26, 2019

Would you plan to support reporting in Code Climate format?

This will allow usage of pyflakes as Code Climate engine, so many Python developers will be able to use it in their CI workflows.

It seems that the spec is not so complicated. If you agree with the need to support Code Climate reports, I'll implement it.

@sigmavirus24
Copy link
Member

Given that there are no command-line options that affect behaviour in this tool today, I suspect @bitglue will rule this out. I do think Flake8 would be able to easily implement this though and give you the Pyflakes output you want.

@tribals
Copy link
Author

tribals commented Jan 27, 2019

Did you mean that I should use flake8 instead?

If so, I disagree. I'm using pyflakes exactly why I don't use flake8. It is that flake8 combines multiple tools in one: it checks for style of code as well as errors that can be caught at static analysis. I don't want so. I'm using another tool for code formatting according to style with which many of my teammates agree (it is black, if you are interested). So, I need just static analyzer which is exactly what is pyflakes.

It is acceptable to introduce additional command line switch? If not, just close issue.

@asottile
Copy link
Member

flake8 --select=F is basically "pyflakes but with features" if you're interested

@tribals
Copy link
Author

tribals commented Jan 27, 2019

Yes, I do. Thank you. I'll check this out.

@bitglue
Copy link
Member

bitglue commented Feb 6, 2019

I'm not familiar with the code climate format, but if it's just a matter of the appropriate syntax for errors, it would also be relatively simple to implement a small Python script which invokes pyflakes as a module and then outputs the appropriately formatted errors. See the implementation of main() for a starting point, then replace the reporter with whatever you need.

If it helps people, it doesn't add any dependencies, and it's a small amount of code, I'm not opposed to including the implementation in pyflakes. I've tried to avoid any options that affect how or what gets checked, since if there are no false positives there should be nothing to configure. But an option to control the output formatting should be benign.

@bitglue bitglue reopened this Feb 6, 2019
@sigmavirus24
Copy link
Member

Honestly, looking further into this, it seems like separate tools that import an API and use their own thing, e.g., https://github.com/codeclimate/codeclimate-eslint so I don't think this needs to live or be distributed with pyflakes

@tribals
Copy link
Author

tribals commented Feb 7, 2019

@bitglue This is exactly what I thought about last evening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants