CLASPLint 0.5.1__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/__init__.py +2 -2
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/__main__.py +5 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/checker_base.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/comment_checker.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/configuration.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/configuration.yaml +38 -4
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/dict_key_checker.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/docstring_checker.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/function_checker.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/log_checker.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/naming_utils.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/reporter.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/runner.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/try_except_checker.py +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint/variable_checker.py +22 -14
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint.egg-info/PKG-INFO +4 -4
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/PKG-INFO +4 -4
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/README.md +3 -3
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/pyproject.toml +1 -1
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/setup.py +2 -2
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint.egg-info/SOURCES.txt +0 -0
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint.egg-info/dependency_links.txt +0 -0
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint.egg-info/entry_points.txt +0 -0
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint.egg-info/not-zip-safe +0 -0
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/CLASPLint.egg-info/top_level.txt +0 -0
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/LICENSE +0 -0
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/MANIFEST.in +0 -0
- {CLASPLint-0.5.1 → CLASPLint-0.5.2}/setup.cfg +0 -0
|
@@ -24,7 +24,7 @@ PROJECT CREATE DATE : 2026-06-17
|
|
|
24
24
|
|
|
25
25
|
PROJECT VERSION DATE : 2026-07-11
|
|
26
26
|
|
|
27
|
-
PROJECT VERSION : 0.5.
|
|
27
|
+
PROJECT VERSION : 0.5.2
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
FILE CREATE DATE : 2026-06-17
|
|
@@ -71,6 +71,6 @@ Sort License:
|
|
|
71
71
|
"""
|
|
72
72
|
|
|
73
73
|
# Define the package version string.
|
|
74
|
-
__version__ = "0.5.
|
|
74
|
+
__version__ = "0.5.2"
|
|
75
75
|
# Expose the runner and reporter modules as the public API.
|
|
76
76
|
__all__ = ["runner", "reporter"]
|
|
@@ -22,7 +22,7 @@ PROJECT CREATE DATE : 2026-06-17
|
|
|
22
22
|
|
|
23
23
|
PROJECT VERSION DATE : 2026-07-11
|
|
24
24
|
|
|
25
|
-
PROJECT VERSION : 0.5.
|
|
25
|
+
PROJECT VERSION : 0.5.2
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
FILE CREATE DATE : 2026-06-17
|
|
@@ -159,6 +159,10 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
|
|
|
159
159
|
:return: Exit code 0 when no violations are found, 1 otherwise.
|
|
160
160
|
:rtype: int
|
|
161
161
|
"""
|
|
162
|
+
# Ensure stdout and stderr use UTF-8 encoding for cross-platform Chinese output.
|
|
163
|
+
sys.stdout.reconfigure(encoding='utf-8')
|
|
164
|
+
# Reconfigure the standard error stream to use UTF-8 encoding.
|
|
165
|
+
sys.stderr.reconfigure(encoding='utf-8')
|
|
162
166
|
# Build and parse command-line arguments.
|
|
163
167
|
command_parser = _init_build_parser_function_()
|
|
164
168
|
# Parse the provided arguments or default to sys.argv.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
3
|
THIS FILE IS CORE PART OF CLASPLINT BY MATT BELFAST BROWN.
|
|
4
4
|
|
|
@@ -26,14 +26,14 @@ PROJECT CREATE DATE : 2026-06-17
|
|
|
26
26
|
|
|
27
27
|
PROJECT VERSION DATE : 2026-07-11
|
|
28
28
|
|
|
29
|
-
PROJECT VERSION : 0.5.
|
|
29
|
+
PROJECT VERSION : 0.5.2
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
FILE CREATE DATE : 2026-07-06
|
|
33
33
|
|
|
34
|
-
FILE VERSION DATE : 2026-07-
|
|
34
|
+
FILE VERSION DATE : 2026-07-11
|
|
35
35
|
|
|
36
|
-
FILE VERSION : 1.0.
|
|
36
|
+
FILE VERSION : 1.0.1
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
STATUS : Stable
|
|
@@ -341,6 +341,40 @@ bool_words:
|
|
|
341
341
|
- is
|
|
342
342
|
# Require the has prefix to mark boolean possession-checking variables.
|
|
343
343
|
- has
|
|
344
|
+
# Require the bool prefix to mark boolean type-prefixed variables.
|
|
345
|
+
- bool
|
|
346
|
+
# Require the should prefix to mark boolean recommendation variables.
|
|
347
|
+
- should
|
|
348
|
+
# Require the can prefix to mark boolean capability-checking variables.
|
|
349
|
+
- can
|
|
350
|
+
# Require the does prefix to mark boolean action-status variables.
|
|
351
|
+
- does
|
|
352
|
+
# Require the did prefix to mark boolean past-action variables.
|
|
353
|
+
- did
|
|
354
|
+
# Require the do prefix to mark boolean imperative variables.
|
|
355
|
+
- do
|
|
356
|
+
# Require the will prefix to mark boolean future-intent variables.
|
|
357
|
+
- will
|
|
358
|
+
# Require the was prefix to mark boolean past-state variables.
|
|
359
|
+
- was
|
|
360
|
+
# Require the were prefix to mark boolean past-plural variables.
|
|
361
|
+
- were
|
|
362
|
+
# Require the could prefix to mark boolean possibility variables.
|
|
363
|
+
- could
|
|
364
|
+
# Require the would prefix to mark boolean hypothetical variables.
|
|
365
|
+
- would
|
|
366
|
+
# Require the might prefix to mark boolean uncertainty variables.
|
|
367
|
+
- might
|
|
368
|
+
# Require the must prefix to mark boolean requirement variables.
|
|
369
|
+
- must
|
|
370
|
+
# Require the needs prefix to mark boolean need-indication variables.
|
|
371
|
+
- needs
|
|
372
|
+
# Require the contains prefix to mark boolean membership variables.
|
|
373
|
+
- contains
|
|
374
|
+
# Require the allows prefix to mark boolean permission variables.
|
|
375
|
+
- allows
|
|
376
|
+
# Require the supports prefix to mark boolean feature-check variables.
|
|
377
|
+
- supports
|
|
344
378
|
|
|
345
379
|
# Vague verbs that trigger function name warnings when used at the start.
|
|
346
380
|
verbs_vague:
|
|
@@ -22,14 +22,14 @@ PROJECT CREATE DATE : 2026-06-17
|
|
|
22
22
|
|
|
23
23
|
PROJECT VERSION DATE : 2026-07-11
|
|
24
24
|
|
|
25
|
-
PROJECT VERSION : 0.5.
|
|
25
|
+
PROJECT VERSION : 0.5.2
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
FILE CREATE DATE : 2026-06-17
|
|
29
29
|
|
|
30
30
|
FILE VERSION DATE : 2026-07-11
|
|
31
31
|
|
|
32
|
-
FILE VERSION : 1.0.
|
|
32
|
+
FILE VERSION : 1.0.2
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
STATUS : Stable
|
|
@@ -360,10 +360,12 @@ class VariableChecker(ast.NodeVisitor):
|
|
|
360
360
|
if isinstance(target_node, ast.Name):
|
|
361
361
|
# Extract the identifier from the Name node.
|
|
362
362
|
target_name = target_node.id
|
|
363
|
-
# Check attribute targets
|
|
363
|
+
# Check attribute targets only for self or cls instance variables.
|
|
364
364
|
elif isinstance(target_node, ast.Attribute):
|
|
365
|
-
#
|
|
366
|
-
|
|
365
|
+
# Only extract the attribute name when the object is self or cls.
|
|
366
|
+
if isinstance(target_node.value, ast.Name) and target_node.value.id in ('self', 'cls'):
|
|
367
|
+
# Extract the attribute name from the Attribute node.
|
|
368
|
+
target_name = target_node.attr
|
|
367
369
|
# Validate the extracted name when it is not exempt from checks.
|
|
368
370
|
if target_name and target_name not in names_exempt:
|
|
369
371
|
# Detect any uppercase letter in the variable name.
|
|
@@ -431,10 +433,12 @@ class VariableChecker(ast.NodeVisitor):
|
|
|
431
433
|
if isinstance(target_node, ast.Name):
|
|
432
434
|
# Retrieve the identifier from the Name node.
|
|
433
435
|
target_name = target_node.id
|
|
434
|
-
# Extract the attribute name
|
|
436
|
+
# Extract the attribute name only for self.xxx or cls.xxx Attribute targets.
|
|
435
437
|
elif isinstance(target_node, ast.Attribute):
|
|
436
|
-
#
|
|
437
|
-
|
|
438
|
+
# Only retrieve the attribute name when the object is self or cls.
|
|
439
|
+
if isinstance(target_node.value, ast.Name) and target_node.value.id in ('self', 'cls'):
|
|
440
|
+
# Retrieve the attribute name portion from the Attribute node.
|
|
441
|
+
target_name = target_node.attr
|
|
438
442
|
# Skip when no valid name was extracted or the name is exempt.
|
|
439
443
|
if not target_name or target_name in names_exempt:
|
|
440
444
|
# Proceed to the next target.
|
|
@@ -511,10 +515,12 @@ class VariableChecker(ast.NodeVisitor):
|
|
|
511
515
|
if isinstance(ast_node.target, ast.Name):
|
|
512
516
|
# Retrieve the variable name from the Name node.
|
|
513
517
|
target_name = ast_node.target.id
|
|
514
|
-
# Extract the attribute name
|
|
518
|
+
# Extract the attribute name only for self.xxx or cls.xxx Attribute targets.
|
|
515
519
|
elif isinstance(ast_node.target, ast.Attribute):
|
|
516
|
-
#
|
|
517
|
-
|
|
520
|
+
# Only retrieve the attribute name when the object is self or cls.
|
|
521
|
+
if isinstance(ast_node.target.value, ast.Name) and ast_node.target.value.id in ('self', 'cls'):
|
|
522
|
+
# Retrieve the attribute name portion from the Attribute node.
|
|
523
|
+
target_name = ast_node.target.attr
|
|
518
524
|
# Validate the bool prefix when a name was extracted and is not exempt.
|
|
519
525
|
if target_name and target_name not in names_exempt:
|
|
520
526
|
# Extract the first underscore-separated group.
|
|
@@ -729,10 +735,12 @@ class VariableChecker(ast.NodeVisitor):
|
|
|
729
735
|
elif isinstance(target, ast.Starred):
|
|
730
736
|
# Recursively walk the value inside the starred expression.
|
|
731
737
|
self._init_walk_target_function_(target.value)
|
|
732
|
-
# Validate instance variable names assigned via self.attr
|
|
738
|
+
# Validate instance variable names only when assigned via self.attr or cls.attr.
|
|
733
739
|
elif isinstance(target, ast.Attribute):
|
|
734
|
-
#
|
|
735
|
-
|
|
740
|
+
# Only validate attribute names on self or cls instances.
|
|
741
|
+
if isinstance(target.value, ast.Name) and target.value.id in ('self', 'cls'):
|
|
742
|
+
# Extract the attribute name part beyond the dot for validation.
|
|
743
|
+
self._init_check_name_function_(target.attr, target)
|
|
736
744
|
# Skip subscript assignments (obj[key] = ...) as these are not variable definitions.
|
|
737
745
|
elif isinstance(target, ast.Subscript):
|
|
738
746
|
# Take no action for subscript assignment targets.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: CLASPLint
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: CLASP Stage 3.3 / PEP 2606 Static Analysis Tool — enforces naming and comment conventions beyond PEP 8.
|
|
5
5
|
Author: Matt Belfast Brown
|
|
6
6
|
Author-email: Matt Belfast Brown <thedayofthedo@gmail.com>
|
|
@@ -27,11 +27,11 @@ Requires-Python: >=3.8
|
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
|
|
30
|
-
# CLASPLint
|
|
30
|
+
# CLASPLint
|
|
31
31
|
|
|
32
32
|
[](https://www.python.org/)
|
|
33
33
|
[](./LICENSE)
|
|
34
|
-
[](https://pypi.org/project/CLASPLint/)
|
|
35
35
|
|
|
36
36
|
> CLASP Stage 3.3 / PEP 2606 static analysis tool. Enforces naming and comment conventions beyond PEP 8 —
|
|
37
37
|
> checks variables, dictionary keys, functions, classes, comments, and log messages for standards
|
|
@@ -210,7 +210,7 @@ CLASPLint supports **Python 3.8 through 3.14**. The minimum version is 3.8 due t
|
|
|
210
210
|
|
|
211
211
|
[](https://www.python.org/)
|
|
212
212
|
[](./LICENSE)
|
|
213
|
-
[](https://pypi.org/project/CLASPLint/)
|
|
214
214
|
|
|
215
215
|
> **CLASP Stage 3.3 / PEP 2606** 静态分析工具。在 PEP 8 **之上**强制执行命名与注释规范 ——
|
|
216
216
|
> 检查变量、字典键、函数、类、注释和日志消息是否符合标准。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: CLASPLint
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: CLASP Stage 3.3 / PEP 2606 Static Analysis Tool — enforces naming and comment conventions beyond PEP 8.
|
|
5
5
|
Author: Matt Belfast Brown
|
|
6
6
|
Author-email: Matt Belfast Brown <thedayofthedo@gmail.com>
|
|
@@ -27,11 +27,11 @@ Requires-Python: >=3.8
|
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
|
|
30
|
-
# CLASPLint
|
|
30
|
+
# CLASPLint
|
|
31
31
|
|
|
32
32
|
[](https://www.python.org/)
|
|
33
33
|
[](./LICENSE)
|
|
34
|
-
[](https://pypi.org/project/CLASPLint/)
|
|
35
35
|
|
|
36
36
|
> CLASP Stage 3.3 / PEP 2606 static analysis tool. Enforces naming and comment conventions beyond PEP 8 —
|
|
37
37
|
> checks variables, dictionary keys, functions, classes, comments, and log messages for standards
|
|
@@ -210,7 +210,7 @@ CLASPLint supports **Python 3.8 through 3.14**. The minimum version is 3.8 due t
|
|
|
210
210
|
|
|
211
211
|
[](https://www.python.org/)
|
|
212
212
|
[](./LICENSE)
|
|
213
|
-
[](https://pypi.org/project/CLASPLint/)
|
|
214
214
|
|
|
215
215
|
> **CLASP Stage 3.3 / PEP 2606** 静态分析工具。在 PEP 8 **之上**强制执行命名与注释规范 ——
|
|
216
216
|
> 检查变量、字典键、函数、类、注释和日志消息是否符合标准。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# CLASPLint
|
|
1
|
+
# CLASPLint
|
|
2
2
|
|
|
3
3
|
[](https://www.python.org/)
|
|
4
4
|
[](./LICENSE)
|
|
5
|
-
[](https://pypi.org/project/CLASPLint/)
|
|
6
6
|
|
|
7
7
|
> CLASP Stage 3.3 / PEP 2606 static analysis tool. Enforces naming and comment conventions beyond PEP 8 —
|
|
8
8
|
> checks variables, dictionary keys, functions, classes, comments, and log messages for standards
|
|
@@ -181,7 +181,7 @@ CLASPLint supports **Python 3.8 through 3.14**. The minimum version is 3.8 due t
|
|
|
181
181
|
|
|
182
182
|
[](https://www.python.org/)
|
|
183
183
|
[](./LICENSE)
|
|
184
|
-
[](https://pypi.org/project/CLASPLint/)
|
|
185
185
|
|
|
186
186
|
> **CLASP Stage 3.3 / PEP 2606** 静态分析工具。在 PEP 8 **之上**强制执行命名与注释规范 ——
|
|
187
187
|
> 检查变量、字典键、函数、类、注释和日志消息是否符合标准。
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "CLASPLint"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.2"
|
|
8
8
|
description = "CLASP Stage 3.3 / PEP 2606 Static Analysis Tool — enforces naming and comment conventions beyond PEP 8."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "GPL-3.0-only"}
|
|
@@ -25,7 +25,7 @@ PROJECT CREATE DATE : 2026-06-17
|
|
|
25
25
|
|
|
26
26
|
PROJECT VERSION DATE : 2026-07-11
|
|
27
27
|
|
|
28
|
-
PROJECT VERSION : 0.5.
|
|
28
|
+
PROJECT VERSION : 0.5.2
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
FILE CREATE DATE : 2026-06-17
|
|
@@ -75,7 +75,7 @@ setup(
|
|
|
75
75
|
# Declare the package name used for PyPI registration and pip install.
|
|
76
76
|
name="CLASPLint",
|
|
77
77
|
# Declare the semantic version following major.minor.patch convention.
|
|
78
|
-
version="0.5.
|
|
78
|
+
version="0.5.2",
|
|
79
79
|
|
|
80
80
|
# Provide a brief description of the tool for PyPI and help text.
|
|
81
81
|
description="CLASP Stage 3.3 / PEP 2606 Static Analysis Tool",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|