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

explicitly note that arbitrary strings are supported by flake8 - [closed] #1253

Closed
asottile opened this issue Apr 3, 2021 · 13 comments
Closed

Comments

@asottile
Copy link
Member

asottile commented Apr 3, 2021

In GitLab by @keisheiled on Nov 27, 2019, 03:13

Merges patch-1 -> master

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @keisheiled on Nov 27, 2019, 03:15

restored source branch patch-1

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @codecov on Nov 27, 2019, 03:16

Codecov Report

Merging #385 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #385   +/-   ##
=======================================
  Coverage   82.74%   82.74%           
=======================================
  Files          24       24           
  Lines        2416     2416           
  Branches      378      378           
=======================================
  Hits         1999     1999           
  Misses        355      355           
  Partials       62       62

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e571167...da6d162. Read the comment docs.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @keisheiled on Nov 27, 2019, 03:19

Context: flake8-implicit-str-concat/flake8-implicit-str-concat#3

if this MR or a similar suggestion is not merged I'd like to see [A-Z]{1,3}\d{3,} explicitly recommended as it appears to have become a defacto standard

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @pjacock on Nov 27, 2019, 03:20

+1 for much stronger language recommending the ABC123 style which will work well with the wider ecosystem of editors, IDEs, lint reporting etc.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @keisheiled on Nov 27, 2019, 03:21

@pjacock which IDEs do not support all possible flake8 error codes currently?

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @pjacock on Nov 27, 2019, 03:25

The example I was thinking of has since been fixed to support ABC123 style - that took over six months though: microsoft/vscode-python#4074

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @hugovk on Nov 27, 2019, 03:27

Examples from flake8-implicit-str-concat/flake8-implicit-str-concat#3:

Should Flake8 plugins use error codes like ISC001 and ISC002 or are longer strings like implicit-str-concat-oneline and implicit-str-concat-continuation?

And can the Flake8 project offer guidance or requirements?

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @hugovk on Nov 27, 2019, 04:27

From the docs on "Error / Violation Codes":

Flake8 and its plugins assign a code to each message that we refer to as a error code (or violation). Most plugins will list their error codes in their documentation or README.

http://flake8.pycqa.org/en/latest/user/error-codes.html

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @keisheiled on Nov 27, 2019, 04:36

error code doesn't actually have a glossary definition, this would be a good place to add such a recommendation on what they should actually look like: http://flake8.pycqa.org/en/latest/glossary.html#term-error-code

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @pjacock on Nov 27, 2019, 05:04

@keisheiled my reading of that page is that error, error code, and violation are interchangeable terms.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @asottile on Nov 27, 2019, 05:46

arbitrary strings are not supported, they may appear to work in some cases but the framework really should be raising errors in those cases -- could you please open an issue for that?

here is what's supported: https://gitlab.com/pycqa/flake8/blob/e571167161a42a5da052eaf247ab13ac0c56b7c6/src/flake8/defaults.py#L39

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @asottile on Nov 27, 2019, 05:46

closed

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @pjacock on Nov 27, 2019, 06:13

New issue opened as requested, see #597.

@asottile asottile closed this as completed Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant