Skip to content

Commit c78b719

Browse files
authored
Merge pull request #51 from George-Ogden/linter
Remove Linting Rule
2 parents 2ae62a6 + d98796b commit c78b719

20 files changed

+14
-343
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ repos:
2222
symbols\ and\ spaces|
2323
)
2424
25+
- repo: https://github.com/George-Ogden/linter
26+
rev: v1.1.0
27+
hooks:
28+
- id: lint
29+
exclude: ^tests/[^/].*/test_data/
30+
2531
- repo: https://github.com/astral-sh/ruff-pre-commit
2632
rev: v0.14.4
2733
hooks:
@@ -40,7 +46,6 @@ repos:
4046
exclude: ^tests/[^/]*/test_data/
4147
additional_dependencies:
4248
- GitPython
43-
- libcst==1.8.5
4449
- pytest
4550

4651
- repo: https://github.com/codespell-project/codespell

.pre-commit-hooks.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,3 @@
4343
language: python
4444
stages: [commit-msg]
4545
additional_dependencies: [codespell]
46-
47-
- id: dict-rewrite
48-
name: Rewrite string-keyed dictionaries to use `dict`.
49-
entry: dict-rewrite
50-
types: [python]
51-
language: python
52-
additional_dependencies: [libcst==1.8.5]

README.md

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ This repository provides the following pre-commit hooks:
1818
- [check-merge-conflict](#check-merge-conflict) - check for merge conflicts.
1919
- [mypy](#mypy) - run [MyPy](#https://github.com/python/mypy).
2020
- [spell-check-commit-msgs](#spell-check-commit-msgs) - check for spelling errors in commit messages.
21-
- [dict-rewrite](#dict-rewrite) - rewrite string-keyed dictionaries to use `dict`.
2221

2322
### dbg-check
2423

@@ -59,28 +58,6 @@ You can set the MyPy version in the requirements file (eg `mypy==1.17.1`), other
5958
This uses [`codespell`](https://github.com/codespell-project/codespell) under the hood, and accepts the same flags via the `args` field, but interactive mode is not supported.
6059
You need to ensure that you install the `commit-msg` hooks, which you can do with `pre-commit install -t pre-commit -t commit-msg` or adding `default_install_hook_types: ["pre-commit", "commit-msg"]` to the `.pre-commit-config.yaml` (like below).
6160

62-
### dict-rewrite
63-
64-
Make string-based dictionaries use `dict` instead of curly braces. For example,
65-
66-
```python
67-
{
68-
"a": "ascii",
69-
"r": repr,
70-
"integer": 15,
71-
}
72-
# is rewritten as
73-
dict(
74-
a="ascii",
75-
r=repr,
76-
integer=15
77-
)
78-
```
79-
80-
Use the `--fix` arg to apply the change, as well as linting files.
81-
The change may disrupt the style of the code, so consider using a formatter, such as [`ruff`](https://github.com/astral-sh/ruff/).
82-
It is possible to ignore dictionaries using `# dict-ignore`.
83-
8461
## Example Use
8562

8663
Here's a sample `.pre-commit-config.yaml`:
@@ -97,8 +74,14 @@ repos:
9774
- id: mixed-line-ending
9875
- id: trailing-whitespace
9976

77+
- repo: https://github.com/George-Ogden/linter
78+
rev: v1.1.0
79+
hooks:
80+
- id: lint
81+
exclude: ^tests/[^/].*/test_data/
82+
10083
- repo: https://github.com/George-Ogden/pre-commit-hooks/
101-
rev: v1.4.3
84+
rev: v2.0.0
10285
hooks:
10386
- id: dbg-check
10487
exclude: ^test/
@@ -109,8 +92,6 @@ repos:
10992
- id: mypy
11093
args: [-r, requirements.txt, --strict]
11194
- id: spell-check-commit-msgs
112-
- id: dict-rewrite
113-
args: [--fix]
11495
```
11596
11697
### Development

dict_rewrite.py

Lines changed: 0 additions & 175 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
[project]
22
name = "Pre-Commit-Hooks"
3-
version = "1.4.3"
3+
version = "2.0.0"
44
requires-python = ">=3.9,<3.15"
55

6-
[project.scripts]
7-
dict-rewrite = "dict_rewrite:main_cli"
8-
96
[build-system]
107
requires = ["setuptools"]
118
build-backend = "setuptools.build_meta"
129

1310
[tool.setuptools]
1411
packages = []
15-
py-modules = ["dict_rewrite"]
1612
script-files = ["./run-spell-check.sh"]
1713

1814
[tool.ruff]

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
libcst==1.8.5

tests/dict-rewrite/test_commented.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/dict-rewrite/test_data/commented.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/dict-rewrite/test_data/empty.py

Whitespace-only changes.

tests/dict-rewrite/test_data/errors.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)