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/ )
44Install 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 )
77View 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
5759Example 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 #
7981def 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
9294repos :
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
100102Run:
@@ -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
116118Clone 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
121123pip install -e .[dev]
122124pytest
123125```
0 commit comments