A plugin for Flake8; Ensuring that your Python code adheres to CarrotManMatt's opinionated style guide.
Project description
flake8-carrot
A plugin for Flake8; Ensuring that your Python code adheres to CarrotManMatt's opinionated style guide
Rules
CAR101-missing-all-export
Every module should have an__all__export at the topCAR102-multiple-all-exports
Each module should have only a single__all__exportCAR103-incorrect-all-export-annotation
An__all__export should be annotated asSequence[str]CAR104-incorrect-all-export-type
A simple__all__export should be of typetuple, notlistCAR105-invalid-line-above-all-export
Only import statements and the module’s docstring are allowed above an__all__exportCAR110-incorrect-newlines-after-all-export
A double newline is required after an__all__exportCAR111-incorrect-newlines-separating-preamble
Preamble lines should be separated by a single newlineCAR120-incorrect-whitespace-in-ignore-comment
Whitespace intype: ignore&pass:[noqa: ]comments should follow the standard formatting conventionsCAR121-trailing-commas-after-ignore-comment
type: ignorecomments should have no trailing commasCAR122-trailing-commas-after-ignore-comment
Apass:[noqa: ]comment should be placed after atype: ignorecomment on the same lineCAR123-trailing-commas-after-ignore-comment
Line comments should be placed before atype: ignoreorpass:[noqa: ]commentCAR124-found-noinspection-comment
IDE specific ignore comments (E.g.# noinspection ...) should be removedCAR130- ...
Reserved for lint rules related to literal string flags (r,f,b,u&t).CAR140-unnecessary-str-strip
Unnecessary uses of thestr.strip()function should be removedCAR141-str-function-output-not-stored
The result from calling astrfunction should always be stored in a variableCAR150-args-or-kwargs-in-function-definition
Do not use**argsor***kwargsin function definitions (where possible)CAR151-args-or-kwargs-passed-to-super
Do not pass**argsor***kwargstosuper()methodsCAR160-class-defined-inside-function
Classes should only be defined at the module top-level or inside another class, (not inside a function)CAR161-content-in-abstract-method
The body of abstract methods should only contain a docstring (orpassif the function is an overload or is private and has no docstring)CAR162-classproperty-not-all-caps
Class-property names should be in all capsCAR162-init-not-marked-with-override
__init__()methods should always be marked with@overrideCAR170-union-in-isinstance-or-issubclass
Use tuples of types in calls toisinstance()orissubclassrather than type unionsCAR180-repeated-bool-op
Useany()rather than repeated... or ...clauses andall()rather than repeated... and ..clausesCAR201-incorrect-logger-assignment-annotation
Assignment of alogging.Loggerobject to a variable should be annotated asFinal[Logger]CAR202-logger-variable-name-missing-logger
Alogging.Loggervariable’s name should contain the word 'logger'CAR301-invalid-characters-in-pycord-slash-command-or-option-name
Pycord slash-command/option names should only contain valid charactersCAR302-invalid-pycord-cog-subclass-name
Pycord cog subclass' should have a name that ends withCommandCogorCommandsCog(depending upon the number of commands in the cog)CAR303-incorrectly-formatted-pycord-slash-command-or-option-name
Pycord slash-command/option names should be lowercase and have words separated by hyphensCAR304-missing-full-stop-in-pycord-slash-command-or-option-description
Pycord slash-command/option descriptions should end with a full stopCAR305-pycord-context-command-name-uncapitalised
Pycord user/message context command names should be capitalisedCAR401-found-astpretty-pprint
Debugging calls toastpretty.pprint()should be removedCAR501-used-dataclass
Classes should have their attributes declared manually withoutdataclass"magic"CAR601-used-re-match
re.fullmatch()should be used instead ofre.match()CAR602-used-re-search-with-line-anchors
re.fullmatch()should be used instead ofre.search()when using beginning and ending line anchorsCAR610-non-raw-string-for-regex-pattern
Regex pattern string literals should be written with raw (rstrings)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flake8_carrot-0.1.1.tar.gz
(30.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_carrot-0.1.1.tar.gz.
File metadata
- Download URL: flake8_carrot-0.1.1.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a79c97660ab5c6229d56d095b883104b3f5d453ada8504d2dddecb7fdb48c8cd
|
|
| MD5 |
4824cba31bfd349c16707d3a1ac5960f
|
|
| BLAKE2b-256 |
763fd453f4cbfea0e2f8f24a8aefee0e7e4b77645149b927f59b07b017f351a4
|
File details
Details for the file flake8_carrot-0.1.1-py3-none-any.whl.
File metadata
- Download URL: flake8_carrot-0.1.1-py3-none-any.whl
- Upload date:
- Size: 52.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7af1777e47a747a41f4c5bbb0ed398dce72172366fa6657b99868a2494f6e21b
|
|
| MD5 |
15a2b35216fea1ccc4c592b11df2078f
|
|
| BLAKE2b-256 |
acdccd88d5e5b001e27400b8185a791c39247cde95c9fabc408f014a036bbfbe
|