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

Use flake8 error code format #5

Closed
vcabbage opened this issue Jan 18, 2016 · 5 comments
Closed

Use flake8 error code format #5

vcabbage opened this issue Jan 18, 2016 · 5 comments

Comments

@vcabbage
Copy link

flake8 defines warning and error codes as "an upper case ASCII letter followed by three digits" (http://flake8.readthedocs.org/en/latest/warnings.html). FI## doesn't fit this format.

I ran into the issue with Jenkins' Violations plugin which uses a strict regex which doesn't match the FI## pattern (https://github.com/jenkinsci/violations-plugin/blob/cab7103b/src/main/java/hudson/plugins/violations/types/pep8/Pep8Parser.java#L41).

Would you be open to changing the error code format? Possibly using an opt-in flag to avoid to not break existing configurations.

@xZise
Copy link
Owner

xZise commented May 29, 2016

In principle yes, but to be honest there are only so much letters (aka 26) and so it's problematic to use another letter. F is already used by pep8/flake8 itself and I is used by the flake8-import-order.

But maybe it's possible to share the same letter, especially as my plugin is similar to flake8-import-order. And an opt-in flag would certainly be possible but the question is what other prefix. Making it completely free would probably cause to much confusion, but in case I'm going to change it, it is probably sensible. Although I don't consider it finished and so users should expect that the format changes (maybe with a grace period where it's possible to opt-in into the new first, then opt-out into the old).

@lorengordon
Copy link

I suspect this might also be the reason the flake8-linter for Atom does not display the violations raised by this plugin. Following their code is difficult for me, but I think perhaps this regex is the issue...

@labrys
Copy link

labrys commented Apr 7, 2019

@xZise It is possible to share codes with other projects. For example flake8-commas and flake8-comprehensions both use the Cxxx namespace which is already used by flake8 for cyclomatic complexity. The issue is to make sure to not stomp on the same error code ranges. As your project won't ever likely have a large number of error codes, I don't see this as an issue. I would probably contact the existing project (e.g. flake8-import-order) as a courtesy to avoid namespace collisions.

@xZise
Copy link
Owner

xZise commented Feb 18, 2020

I actually raised this issue with the other plugin and you probably won't like their response.

I actually need to retract this comment because @sigmavirus24's response there isn't speaking for the project itself. But it still leaves the issue that I don't really like to "just" use another project's error code space without coordinating with them. And I agree with the following sentiment:

In short, agreements to share namespaces only work so long as everyone involved remembers they're sharing and negotiating and don't need to grow beyond their existing range.

@xZise
Copy link
Owner

xZise commented Aug 6, 2022

Hi, as noted in the documentation of Flake8 itself, the code can be build from up to three letters. As such I'd prefer to stay with the current format for now.

@xZise xZise closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2022
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