lint-utils 0.2.0__tar.gz → 0.2.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.
Files changed (27) hide show
  1. {lint_utils-0.2.0 → lint_utils-0.2.2}/PKG-INFO +8 -5
  2. {lint_utils-0.2.0 → lint_utils-0.2.2}/README.md +6 -3
  3. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/visitors/base.py +8 -2
  4. {lint_utils-0.2.0 → lint_utils-0.2.2}/pyproject.toml +2 -2
  5. {lint_utils-0.2.0 → lint_utils-0.2.2}/.gitignore +0 -0
  6. {lint_utils-0.2.0 → lint_utils-0.2.2}/LICENSE +0 -0
  7. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/__init__.py +0 -0
  8. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/__main__.py +0 -0
  9. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/_cli_commands/__init__.py +0 -0
  10. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/_cli_commands/abc_.py +0 -0
  11. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/_cli_commands/check.py +0 -0
  12. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/_cli_commands/dto.py +0 -0
  13. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/_cli_commands/remind_later.py +0 -0
  14. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/common/__init__.py +0 -0
  15. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/common/files.py +0 -0
  16. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/common/std.py +0 -0
  17. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/common/text_styling.py +0 -0
  18. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/common/timer.py +0 -0
  19. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/config.py +0 -0
  20. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/py.typed +0 -0
  21. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/regex.py +0 -0
  22. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/rules.py +0 -0
  23. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/tree_info.py +0 -0
  24. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/visitors/__init__.py +0 -0
  25. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/visitors/dto.py +0 -0
  26. {lint_utils-0.2.0 → lint_utils-0.2.2}/lint_utils/visitors/useless_fields.py +0 -0
  27. {lint_utils-0.2.0 → lint_utils-0.2.2}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: lint-utils
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: The humble linter package
5
5
  Project-URL: GitHub, https://github.com/barbarrista/lint-utils
6
6
  Author-email: Nikitosio Noskovinni <nik.noskov08@gmail.com>
@@ -46,7 +46,7 @@ full alias `lint-utils check ...`
46
46
 
47
47
  **RL001** - The reminder has expired
48
48
 
49
- Please enter a comment in the format "# lu: RL001[YYYY-MM-DD]: write a note here
49
+ Please enter a comment in the format `# lu: RL001[YYYY-MM-DD]: write a note here`
50
50
 
51
51
  ```python
52
52
  class Command:
@@ -88,13 +88,16 @@ USL001 = []
88
88
 
89
89
  ### exclude
90
90
 
91
- If you put a file path in the exclude list, it will be ignored during checking.
91
+ Paths and glob patterns in the exclude list are ignored during checking. `*` matches across directories, so `tests/*` skips the whole `tests` tree.
92
92
 
93
93
  ```toml
94
94
  ...
95
95
 
96
96
  [tool.lint-utils]
97
- exclude = ["path/to/file.py"]
97
+ exclude = [
98
+ "tests/*",
99
+ "path/to/file.py",
100
+ ]
98
101
  ```
99
102
 
100
103
  ### tool.lint-utils.exclude-base-classes
@@ -32,7 +32,7 @@ full alias `lint-utils check ...`
32
32
 
33
33
  **RL001** - The reminder has expired
34
34
 
35
- Please enter a comment in the format "# lu: RL001[YYYY-MM-DD]: write a note here
35
+ Please enter a comment in the format `# lu: RL001[YYYY-MM-DD]: write a note here`
36
36
 
37
37
  ```python
38
38
  class Command:
@@ -74,13 +74,16 @@ USL001 = []
74
74
 
75
75
  ### exclude
76
76
 
77
- If you put a file path in the exclude list, it will be ignored during checking.
77
+ Paths and glob patterns in the exclude list are ignored during checking. `*` matches across directories, so `tests/*` skips the whole `tests` tree.
78
78
 
79
79
  ```toml
80
80
  ...
81
81
 
82
82
  [tool.lint-utils]
83
- exclude = ["path/to/file.py"]
83
+ exclude = [
84
+ "tests/*",
85
+ "path/to/file.py",
86
+ ]
84
87
  ```
85
88
 
86
89
  ### tool.lint-utils.exclude-base-classes
@@ -1,4 +1,5 @@
1
1
  import ast
2
+ import fnmatch
2
3
  from typing import ClassVar, Protocol
3
4
 
4
5
  from lint_utils.config import LintUtilsConfig
@@ -18,5 +19,10 @@ class BaseVisitor(HasRuleProtocol, ast.NodeVisitor):
18
19
  if self._config is None:
19
20
  return False
20
21
 
21
- can_skip = self.rule in self._config.lint.ignore
22
- return can_skip or self._file_info.path.as_posix() in self._config.exclude
22
+ if self.rule in self._config.lint.ignore:
23
+ return True
24
+
25
+ path = self._file_info.path.as_posix()
26
+ return any(
27
+ fnmatch.fnmatchcase(path, pattern) for pattern in self._config.exclude
28
+ )
@@ -12,7 +12,7 @@ license = {text = "MIT"}
12
12
  name = "lint-utils"
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.11"
15
- version = "0.2.0"
15
+ version = "0.2.2"
16
16
 
17
17
  [project.urls]
18
18
  "GitHub" = "https://github.com/barbarrista/lint-utils"
@@ -59,7 +59,7 @@ changelog_start_rev = "0.1.1"
59
59
  name = "cz_conventional_commits"
60
60
  tag_format = "$version"
61
61
  update_changelog_on_bump = true
62
- version = "0.2.0"
62
+ version = "0.2.2"
63
63
  version_files = [
64
64
  "pyproject.toml:version",
65
65
  ]
File without changes
File without changes
File without changes