Skip to main content

A plugin for Flake8; Ensuring that your Python code adheres to CarrotManMatt's opinionated style guide.

Project description

flake8-carrot

flake8-carrot PyPI Version Python Version flake8 Version Tests Status mypy Status pre-commit Status Ruff uv

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 top
  • CAR102 - multiple-all-exports
    Each module should have only a single __all__ export
  • CAR103 - incorrect-all-export-annotation
    An __all__ export should be annotated as Sequence[str]
  • CAR104 - incorrect-all-export-type
    A simple __all__ export should be of type tuple, not list
  • CAR105 - invalid-line-above-all-export
    Only import statements and the module’s docstring are allowed above an __all__ export
  • CAR110 - incorrect-newlines-after-all-export
    A double newline is required after an __all__ export
  • CAR111 - incorrect-newlines-separating-preamble
    Preamble lines should be separated by a single newline
  • CAR120 - incorrect-whitespace-in-ignore-comment
    Whitespace in type: ignore & pass:[noqa: ] comments should follow the standard formatting conventions
  • CAR121 - trailing-commas-after-ignore-comment
    type: ignore comments should have no trailing commas
  • CAR122 - trailing-commas-after-ignore-comment
    A pass:[noqa: ] comment should be placed after a type: ignore comment on the same line
  • CAR123 - trailing-commas-after-ignore-comment
    Line comments should be placed before a type: ignore or pass:[noqa: ] comment
  • CAR124 - found-noinspection-comment
    IDE specific ignore comments (E.g. # noinspection ...) should be removed
  • CAR130 - ...
    Reserved for lint rules related to literal string flags (r, f, b, u & t).
  • CAR140 - unnecessary-str-strip
    Unnecessary uses of the str.strip() function should be removed
  • CAR141 - str-function-output-not-stored
    The result from calling a str function should always be stored in a variable
  • CAR150 - args-or-kwargs-in-function-definition
    Do not use **args or ***kwargs in function definitions (where possible)
  • CAR151 - args-or-kwargs-passed-to-super
    Do not pass **args or ***kwargs to super() methods
  • CAR160 - 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 (or pass if the function is an overload or is private and has no docstring)
  • CAR162 - classproperty-not-all-caps
    Class-property names should be in all caps
  • CAR162 - init-not-marked-with-override
    __init__() methods should always be marked with @override
  • CAR170 - union-in-isinstance-or-issubclass
    Use tuples of types in calls to isinstance() or issubclass rather than type unions
  • CAR180 - repeated-bool-op
    Use any() rather than repeated ... or ... clauses and all() rather than repeated ... and .. clauses
  • CAR201 - incorrect-logger-assignment-annotation
    Assignment of a logging.Logger object to a variable should be annotated as Final[Logger]
  • CAR202 - logger-variable-name-missing-logger
    A logging.Logger variable’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 characters
  • CAR302 - invalid-pycord-cog-subclass-name
    Pycord cog subclass' should have a name that ends with CommandCog or CommandsCog (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 hyphens
  • CAR304 - missing-full-stop-in-pycord-slash-command-or-option-description
    Pycord slash-command/option descriptions should end with a full stop
  • CAR305 - pycord-context-command-name-uncapitalised
    Pycord user/message context command names should be capitalised
  • CAR401 - found-astpretty-pprint
    Debugging calls to astpretty.pprint() should be removed
  • CAR501 - used-dataclass
    Classes should have their attributes declared manually without dataclass "magic"
  • CAR601 - used-re-match
    re.fullmatch() should be used instead of re.match()
  • CAR602 - used-re-search-with-line-anchors
    re.fullmatch() should be used instead of re.search() when using beginning and ending line anchors
  • CAR610 - non-raw-string-for-regex-pattern
    Regex pattern string literals should be written with raw (r strings)

Project details


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.9.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_carrot-0.1.9-py3-none-any.whl (52.4 kB view details)

Uploaded Python 3

File details

Details for the file flake8_carrot-0.1.9.tar.gz.

File metadata

  • Download URL: flake8_carrot-0.1.9.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for flake8_carrot-0.1.9.tar.gz
Algorithm Hash digest
SHA256 eb5fcbc6c73d0a69bdc6448a5ee0da7f019267aab923874643964d044c8c1c94
MD5 8cda46d3b37fec595e61dd15c67e6b49
BLAKE2b-256 1bbba550a14554fc58aa67adee86f225d15769da70a46be30467b69233705721

See more details on using hashes here.

File details

Details for the file flake8_carrot-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: flake8_carrot-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 52.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for flake8_carrot-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2b6ccbf0126f82a98c8b811b9cbbf29f28b46a901cac3d8dd9101141874431a7
MD5 5397c9b29abc7f5557f6907edc0a5bc2
BLAKE2b-256 cd8425dc34373ed20612d1c1d10e1f2afea8391934a633113dc3ac819bb25f28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page