python-linters 0.1.0__tar.gz → 0.1.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.
- python_linters-0.1.2/LICENSE +21 -0
- {python_linters-0.1.0 → python_linters-0.1.2}/PKG-INFO +9 -4
- {python_linters-0.1.0 → python_linters-0.1.2}/README.md +6 -3
- {python_linters-0.1.0 → python_linters-0.1.2}/pyproject.toml +2 -1
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/ruff.toml +5 -1
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/run_linters.py +3 -3
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/.flake8 +0 -0
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/__init__.py +0 -0
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/add_noqa.py +0 -0
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/fix_code.py +0 -0
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/parse_rules.py +0 -0
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/ruff_rule_categories.py +0 -0
- {python_linters-0.1.0 → python_linters-0.1.2}/python_linters/ruff_rules.txt +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Tilo Himmelsbach
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-linters
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: bundling config files for linters like ruff and flake8
|
|
5
|
+
Home-page: https://github.com/dertilo/python-linters
|
|
5
6
|
Author: Tilo Himmelsbach
|
|
6
7
|
Author-email: dertilo@gmail.com
|
|
7
8
|
Requires-Python: >=3.10,<4.0
|
|
@@ -15,9 +16,13 @@ Requires-Dist: flake8-newspaper-style (>=0.4.3,<0.5.0)
|
|
|
15
16
|
Requires-Dist: ruff (>=0.0.291)
|
|
16
17
|
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
17
18
|
Requires-Dist: wemake-python-styleguide (>=0.18.0,<0.19.0)
|
|
19
|
+
Project-URL: Repository, https://github.com/dertilo/python-linters
|
|
18
20
|
Description-Content-Type: text/markdown
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+

|
|
23
|
+
[](https://opensource.org/licenses/MIT)
|
|
24
|
+
[](https://beartype.readthedocs.io)
|
|
25
|
+
# python-linters
|
|
21
26
|
- bundles flake8, black, isort, ruff into a single poetry-script
|
|
22
27
|
- project independent linter configuration (via `ruff.toml`,`.flake8`) -> one config to rule them all
|
|
23
28
|
### use-cases:
|
|
@@ -38,9 +43,9 @@ python-linters = { version = "<some-version-here>" }
|
|
|
38
43
|
{ include = "my_package_name" },
|
|
39
44
|
]
|
|
40
45
|
```
|
|
41
|
-
b. or via `tool.python-
|
|
46
|
+
b. or via `tool.python-linters`
|
|
42
47
|
```toml
|
|
43
|
-
[tool.python-
|
|
48
|
+
[tool.python-linters]
|
|
44
49
|
folders_to_be_linted=["my_directory","another_dir/my_sub_package"]
|
|
45
50
|
```
|
|
46
51
|
## 2. local development workflow (before pushing to ci-pipeline)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
|
+
[](https://opensource.org/licenses/MIT)
|
|
3
|
+
[](https://beartype.readthedocs.io)
|
|
4
|
+
# python-linters
|
|
2
5
|
- bundles flake8, black, isort, ruff into a single poetry-script
|
|
3
6
|
- project independent linter configuration (via `ruff.toml`,`.flake8`) -> one config to rule them all
|
|
4
7
|
### use-cases:
|
|
@@ -19,9 +22,9 @@ python-linters = { version = "<some-version-here>" }
|
|
|
19
22
|
{ include = "my_package_name" },
|
|
20
23
|
]
|
|
21
24
|
```
|
|
22
|
-
b. or via `tool.python-
|
|
25
|
+
b. or via `tool.python-linters`
|
|
23
26
|
```toml
|
|
24
|
-
[tool.python-
|
|
27
|
+
[tool.python-linters]
|
|
25
28
|
folders_to_be_linted=["my_directory","another_dir/my_sub_package"]
|
|
26
29
|
```
|
|
27
30
|
## 2. local development workflow (before pushing to ci-pipeline)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "python-linters"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.2"
|
|
4
4
|
description = "bundling config files for linters like ruff and flake8"
|
|
5
5
|
authors = ["Tilo Himmelsbach <dertilo@gmail.com>"]
|
|
6
6
|
readme = "README.md"
|
|
7
|
+
repository = "https://github.com/dertilo/python-linters"
|
|
7
8
|
packages = [{ include = "python_linters" }]
|
|
8
9
|
|
|
9
10
|
include=["python_linters/.flake8","python_linters/ruff.toml"]
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
target-version = "py310"
|
|
2
|
+
[lint.isort]
|
|
3
|
+
profile = "black"
|
|
2
4
|
# Exclude a variety of commonly ignored directories. see https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
|
|
3
5
|
[lint]
|
|
4
6
|
exclude = [
|
|
@@ -110,10 +112,12 @@ ignore = [
|
|
|
110
112
|
"RET505", # encurages bad practice of ommitting the "else"-clause
|
|
111
113
|
"RUF100", # RUF100 unused-noqa: ruff does not know about flake8 codes
|
|
112
114
|
"UP008", # see: https://stackoverflow.com/questions/73268995/typeerror-when-calling-super-in-dataclassslots-true-subclass
|
|
115
|
+
"RET506", # looks like a false-positive
|
|
116
|
+
"SLF001", # everybody knows about the _-conventin, if one still accesses "protected" attributes one has their reasons!
|
|
113
117
|
]
|
|
114
118
|
|
|
115
119
|
[lint.mccabe]
|
|
116
|
-
# Flag errors (`C901`) whenever the complexity level exceeds
|
|
120
|
+
# Flag errors (`C901`) whenever the complexity level exceeds some threshold.
|
|
117
121
|
# ruffs default is 10
|
|
118
122
|
# PyCQA default seems to be 7: https://github.com/PyCQA/mccabe/blob/60cf21c21f8e5880f9907561c53732e80d1be400/mccabe.py#L273
|
|
119
123
|
# flake8's default is 10: https://flake8.pycqa.org/en/2.5.5/
|
|
@@ -40,9 +40,9 @@ packages = [
|
|
|
40
40
|
{ include = \"my_package_name\" },
|
|
41
41
|
]
|
|
42
42
|
|
|
43
|
-
b. or via tool.python-
|
|
43
|
+
b. or via tool.python-linters
|
|
44
44
|
|
|
45
|
-
[tool.python-
|
|
45
|
+
[tool.python-linters]
|
|
46
46
|
folders_to_be_linted=["my_directory","another_dir/my_sub_package"]"""
|
|
47
47
|
super().__init__(msg)
|
|
48
48
|
|
|
@@ -56,7 +56,7 @@ def get_folders_to_be_linted(pyproject_toml: str) -> list[str]:
|
|
|
56
56
|
with open(pyproject_toml) as f:
|
|
57
57
|
t = toml.load(f)
|
|
58
58
|
folders = (
|
|
59
|
-
t.get("tool", {}).get("python-
|
|
59
|
+
t.get("tool", {}).get("python-linters", {}).get("folders_to_be_linted", None)
|
|
60
60
|
)
|
|
61
61
|
if (
|
|
62
62
|
folders is None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|