A Python linter focused on naming conventions with 5 strictness levels
Project description
yina
A simple, yet opinionated linter for Python that helps you choose more descriptive variable names.
pip install yina
Usage
- Run
yina lint file.pyto lint a file oryina lint src/for a directory. - Use the
--level Noption to specify the strictness level. Defaults to level 3. - With
yina inityou can generate a configuration file for the working directory with default values you can edit.
Strictness levels
Yina lint operates on 5 strictness levels. Each level includes all the rules from the previous levels.
| Level | Rules |
|---|---|
| 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 "word" in a variable name, like "one" in "one_two_three": - 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 "word" in a variable name, like "one" in "one_two_three": - 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.tomlfile in the working directory, it will be used. - If not, the default
yina-lint/config/yina.tomlfile will be applied.
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
yina-0.1.4.tar.gz
(10.7 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
yina-0.1.4-py3-none-any.whl
(11.4 kB
view details)
File details
Details for the file yina-0.1.4.tar.gz.
File metadata
- Download URL: yina-0.1.4.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2a986b4db9cac26900b1ac4a90ac60802d2adf1bba14c3595318d62a8bed94e
|
|
| MD5 |
d81a54a855af340fda61154a2d5138f3
|
|
| BLAKE2b-256 |
c2da44be74e1896378ccd1dcdb7eb9e117e307a6b1d880185743f732175b55a4
|
File details
Details for the file yina-0.1.4-py3-none-any.whl.
File metadata
- Download URL: yina-0.1.4-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb3e3a82090f8f8e3cb5fc2058b76bd3bc120bf77bf1363bb132b0eb1a5d860a
|
|
| MD5 |
d8a57356c21c3291a31933734ef57f36
|
|
| BLAKE2b-256 |
e8e759d634f344fe8227b8c069b0b7ad11267d2f25aad3d2cca80a39644bd808
|