Skip to main content

A Python linter focused on naming conventions with 5 strictness levels

Project description

README

A simple, yet opinionated linter for Python that helps you choose more descriptive variable names.

Strictness levels

Yina lint operates on 5 strictness levels. Each level includes all the rules from the previous levels.

Level 1: Length and charset

  • Variables must be at least 3 characters long.
  • Variables can only contain characters: a-Z, A-Z, 0-9 and _.
  • Variables cannot start with a number.

Level 2: Naming conventions

  • Snake case will be enforced for regular variables and camel case for class names.
  • All constants must be fully capitalized.
  • Snake case variables that are not constants cannot have capital letters.

Level 3 (default): Word length, max length, repetition

  • Max variable length: 32 characters.
  • Applied for each "segment" in a variable name, like "one" in "one_two_three", or "One" in "OneTwoThree" (for class names):
    • No more than 2 underscores in a row.
    • No more than 2 of the same letter in a row.
    • At least 3 characters long.

Level 4: Pronounceability

  • Applied for each "segment" in a variable name, like "one" in "one_two_three", or "One" in "OneTwoThree" (for class names):
    • At least one vowel
    • No more than 4 consonants in a row

Level 5: Non vagueness

  • No vague words like "item(s)", "thing(s)", "object(s)", "element(s)", "data", "value" or "result". "string" or "dataframe" are also disallowed. Applies only to the entire variable name, vague segments are allowed.
  • No numbers.

Configuration

  • If there is a .yina.toml file in the working directory, it will be used.
  • If not, the default yina-lint/config/yina.toml file will be applied.

You can use the command yina init to create a configuration file for your project with the default values you can modify.

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

yina-0.1.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

yina-0.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file yina-0.1.1.tar.gz.

File metadata

  • Download URL: yina-0.1.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.5

File hashes

Hashes for yina-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2a8c3c532666dda9be138e6fe55bb7c7e4ab9624aed16da219f204a388b49e79
MD5 5868af57f2ee3d84d158fd34efc35f93
BLAKE2b-256 4c685c74377eaec247dc74165b9a1f0c8973325bf3de70ae3fbc8a1a6aeb2c10

See more details on using hashes here.

File details

Details for the file yina-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yina-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.5

File hashes

Hashes for yina-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97fc97c60958d1b4a4ff57316f7dfaac9f0403e74056c112b2fe4d155c92eb83
MD5 f43e206e19b77c8ae93f0055c8d5b2ca
BLAKE2b-256 5516dab2b78939de52e0f6daa0ca8353a2f370cb99df3b8b40b56a0aca2bd64d

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