Skip to content

Commit 3397d39

Browse files
Fix lint error & remove black (#621)
* Fix lint error & remove black Related to #620 Update the lint script and configuration files to fix the lint error. And remove black because ruff replace it. * **scripts/lint.sh** - Update the `ruff` command to use `ruff check` instead of `ruff`. - Remove the `black` command. * **.github/workflows/lint.yml** - Remove `black` from the `Install dependencies` step. * **.pre-commit-config.yaml** - Remove the `black` dependency.
1 parent b933500 commit 3397d39

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip
21-
pip install ruff black
21+
pip install ruff
2222
2323
- name: Run lint script
2424
run: bash scripts/lint.sh

.pre-commit-config.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,3 @@ repos:
1212
hooks:
1313
- id: ruff
1414
args: [ --fix, --exit-non-zero-on-fix ]
15-
16-
- repo: https://github.com/psf/black
17-
rev: 23.7.0
18-
hooks:
19-
- id: black

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,7 @@
256256

257257
1.0.8 31/03/2024
258258
* Fix parsing replications events (#614)
259+
260+
1.0.9 11/08/2024
261+
* Fix typo in ident variable name (#619)
262+
* Remove black and use only ruff as linter

pymysqlreplication/binlogstream.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ def __log_valid_parameters(self):
767767
parameter = parameter.replace("_BinLogStreamReader__", "")
768768
if parameter in ignored or not value:
769769
continue
770-
if type(value) == frozenset:
770+
if value is frozenset:
771771
string_list = [
772772
str(item).split()[-1][:-2].split(".")[2] for item in value
773773
]

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[tool.ruff]
2-
ignore = [
3-
"E501", # Line too long, handled by black
2+
lint.ignore = [
43
"F403", # from module import *' used, It should be removed afterwad
54
"F405", # same to F403
65
]
76

8-
[tool.ruff.per-file-ignores]
7+
[tool.ruff.lint.per-file-ignores]
98
"__init__.py" = ["F401"]

scripts/lint.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
set -e
44
set -x
55

6-
ruff pymysqlreplication
7-
black pymysqlreplication --check
6+
ruff check pymysqlreplication

0 commit comments

Comments
 (0)