Skip to content

Fix lint error & remove black #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff black
pip install ruff

- name: Run lint script
run: bash scripts/lint.sh
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ repos:
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]

- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,7 @@

1.0.8 31/03/2024
* Fix parsing replications events (#614)

1.0.9 11/08/2024
* Fix typo in ident variable name (#619)
* Remove black and use only ruff as linter
2 changes: 1 addition & 1 deletion pymysqlreplication/binlogstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ def __log_valid_parameters(self):
parameter = parameter.replace("_BinLogStreamReader__", "")
if parameter in ignored or not value:
continue
if type(value) == frozenset:
if value is frozenset:
string_list = [
str(item).split()[-1][:-2].split(".")[2] for item in value
]
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[tool.ruff]
ignore = [
"E501", # Line too long, handled by black
lint.ignore = [
"F403", # from module import *' used, It should be removed afterwad
"F405", # same to F403
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
3 changes: 1 addition & 2 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
set -e
set -x

ruff pymysqlreplication
black pymysqlreplication --check
ruff check pymysqlreplication
Loading