Skip to content

Commit 800d2b7

Browse files
author
AlgorithmAlchemy
committed
Change project name for PyPI release
1 parent 065257b commit 800d2b7

File tree

4 files changed

+29
-26
lines changed

4 files changed

+29
-26
lines changed

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
# flake8-only-english
22

3-
[![PyPI version](https://img.shields.io/pypi/v/flake8-non-english.svg?logo=pypi&logoColor=white)](https://pypi.org/project/flake8-only-english/)
3+
[![PyPI version](https://img.shields.io/pypi/v/flake8-only-english.svg?logo=pypi&logoColor=white)](https://pypi.org/project/flake8-only-english/)
44
Install from **PyPI** by clicking the badge above
55

66
[![GitHub](https://img.shields.io/badge/GitHub-Repository-black?logo=github&logoColor=white)](https://github.com/AlgorithmAlchemy/flake8-only-english)
77
View the **source code on GitHub**
88

99
![Downloads](https://pepy.tech/badge/flake8-only-english)
10-
![License](https://img.shields.io/pypi/l/flake8-non-english.svg)
10+
![License](https://img.shields.io/pypi/l/flake8-only-english.svg)
1111

12-
**Flake8 plugin that enforces corporate code style by detecting and reporting any non-English text in Python source code.**
13-
It ensures that comments, docstrings, and string literals are written in English only, maintaining consistency across the codebase.
12+
**Flake8 plugin that enforces corporate code style by detecting and reporting any only-english text in Python source
13+
code.**
14+
It ensures that comments, docstrings, and string literals are written in English only, maintaining consistency across
15+
the codebase.
1416

1517
---
1618

1719
## Features
1820

19-
* Scans Python files for **non-English characters** in:
20-
* Comments (`# ...`)
21-
* Docstrings (`""" ... """` / `''' ... '''`)
22-
* String literals (`"..."` / `'...'`)
23-
* Raises a linting error (`NL001`) when non-English text is found.
21+
* Scans Python files for **only-english characters** in:
22+
* Comments (`# ...`)
23+
* Docstrings (`""" ... """` / `''' ... '''`)
24+
* String literals (`"..."` / `'...'`)
25+
* Raises a linting error (`NL001`) when only-english text is found.
2426
* Works seamlessly with **Flake8** and **pre-commit hooks**.
2527
* Lightweight and dependency-minimal.
2628

@@ -29,7 +31,7 @@ It ensures that comments, docstrings, and string literals are written in English
2931
## Installation
3032

3133
```bash
32-
pip install flake8-non-english
34+
pip install flake8-only-english
3335
````
3436

3537
---
@@ -57,7 +59,7 @@ flake8 --select=NLE002
5759
Example output:
5860

5961
```
60-
/example.py:5:10: NL001 Non-English text detected in comment or string
62+
/example.py:5:10: NL001 only-english text detected in comment or string
6163
```
6264
6365
---
@@ -72,13 +74,13 @@ def hello():
7274
return msg
7375
```
7476

75-
If non-English text is introduced, it will be flagged:
77+
If only-english text is introduced, it will be flagged:
7678

7779
```python
78-
# Comment with non-English text #
80+
# Comment with only-english text #
7981
def hello():
80-
"""Function description with non-English text""" #
81-
msg = "String with non-English text" #
82+
"""Function description with only-english text""" #
83+
msg = "String with only-english text" #
8284
return "Hello"
8385
```
8486

@@ -90,11 +92,11 @@ Add to `.pre-commit-config.yaml`:
9092

9193
```yaml
9294
repos:
93-
- repo: https://github.com/AlgorithmAlchemy/flake8-non-english-comments
95+
- repo: https://github.com/AlgorithmAlchemy/flake8-only-english
9496
rev: v0.1.0
9597
hooks:
9698
- id: flake8
97-
additional_dependencies: [ flake8-non-english ]
99+
additional_dependencies: [ flake8-only-english ]
98100
```
99101
100102
Run:
@@ -107,7 +109,7 @@ pre-commit run --all-files
107109

108110
## Error Codes
109111

110-
* **NL001**Non-English text detected in comment, docstring, or string literal.
112+
* **NL001**only-english text detected in comment, docstring, or string literal.
111113

112114
---
113115

@@ -116,8 +118,8 @@ pre-commit run --all-files
116118
Clone and install in editable mode:
117119

118120
```bash
119-
git clone https://github.com/AlgorithmAlchemy/flake8-non-english-comments
120-
cd flake8-non-english-comments
121+
git clone https://github.com/AlgorithmAlchemy/flake8-only-english
122+
cd flake8-only-english
121123
pip install -e .[dev]
122124
pytest
123125
```

flake8_only_english/checker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class NonEnglishChecker:
88
name = "flake8-only-english"
9-
version = "0.4.0"
9+
version = "0.2.0"
1010

1111
nle_comments = True
1212
nle_strings = True
@@ -99,6 +99,6 @@ def _is_docstring_node(self, node):
9999

100100
def _contains_non_english(self, text):
101101
for ch in text:
102-
if ord(ch) > 127:
102+
if ord(ch) > 127:
103103
return True
104104
return False

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "flake8-only-english"
9-
version = "0.1.0"
9+
version = "0.2.0"
1010
description = "Flake8 plugin to detect non-English comments and string literals"
1111
readme = "README.md"
1212
authors = [
13-
{ name = "AlgorithmAlchemy"}
13+
{ name = "AlgorithmAlchemy" }
1414
]
1515
requires-python = ">=3.8"
1616
keywords = [
1717
"flake8", "linter", "comments", "strings", "non-english", "ascii",
18-
"code-quality", "static-analysis", "plugin", "python","code style",
18+
"code-quality", "static-analysis", "plugin", "python", "code style",
1919
"quality assurance", "code standards"
2020
]
2121
license = { text = "MIT" }

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import pytest
33
from flake8_only_english.checker import NonEnglishChecker
44

5+
56
@pytest.fixture(autouse=True)
67
def reset_flags():
78
NonEnglishChecker.nle_comments = True
89
NonEnglishChecker.nle_strings = False
910
NonEnglishChecker.nle001_enabled = True
10-
NonEnglishChecker.nle002_enabled = True
11+
NonEnglishChecker.nle002_enabled = True

0 commit comments

Comments
 (0)