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. - No more than 2 underscores in a row. - Applied for each "word" in a variable name, like "one" in "one_two_three": - 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.
Metadata
Release files for yina 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yina-0.1.11.tar.gz | 11.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yina-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.8 kB
Release files / yina-0.1.11.tar.gz
| Download URL | yina-0.1.11.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bdc77c0466a05ed0d4460a2acec921b6724ba66bd862965bfd8ca66456f894e
|
|
BLAKE2b-256 checksum How to use checksums |
33382b9a01ae419372a9b3d50cdde77889e15668e436b6aea1a44f42662388bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / yina-0.1.11-py3-none-any.whl
| Download URL | yina-0.1.11-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52a44b7eb9159372d5a2f8c25c010205e731b674335385c9b2415d62902f7348
|
|
BLAKE2b-256 checksum How to use checksums |
528f3f093a50c43f567fd97c02f464c515c1032092524687008a0241ba4a60b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|