Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit465c42d

Browse files
authored
Merge pull request#313 from scrapy/ruff
Migrate to ruff
2 parents076ee4a +6734709 commit465c42d

26 files changed

+351
-252
lines changed

‎.bandit.yml‎

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

‎.bumpversion.cfg‎

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

‎.coveragerc‎

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

‎.flake8‎

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

‎.github/workflows/tests.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ jobs:
4848
tox
4949
5050
-name:Upload coverage report
51-
run:bash <(curl -s https://codecov.io/bash)
51+
uses:codecov/codecov-action@v5

‎.isort.cfg‎

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

‎.pre-commit-config.yaml‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
repos:
2-
-repo:https://github.com/PyCQA/bandit
3-
rev:1.7.10
2+
-repo:https://github.com/astral-sh/ruff-pre-commit
3+
rev:v0.9.3
44
hooks:
5-
-id:bandit
6-
args:[-r, -c, .bandit.yml]
7-
-repo:https://github.com/PyCQA/flake8
8-
rev:7.1.1
9-
hooks:
10-
-id:flake8
11-
-repo:https://github.com/psf/black.git
12-
rev:24.10.0
13-
hooks:
14-
-id:black
15-
-repo:https://github.com/pycqa/isort
16-
rev:5.13.2
17-
hooks:
18-
-id:isort
5+
-id:ruff
6+
args:[ --fix ]
7+
-id:ruff-format

‎docs/conf.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#!/usr/bin/env python
22

3-
importos
43
importsys
4+
frompathlibimportPath
55

66
# Get the project root dir, which is the parent dir of this
7-
cwd=os.getcwd()
8-
project_root=os.path.dirname(cwd)
7+
project_root=str(Path.cwd().parent)
98

109
# Insert the project root dir as the first element in the PYTHONPATH.
1110
# This lets us ensure that the source package is imported, and that its

‎docs/conftest.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
importos
21
fromdoctestimportELLIPSIS,NORMALIZE_WHITESPACE
2+
frompathlibimportPath
33

44
fromsybilimportSybil
55

@@ -16,9 +16,8 @@
1616

1717

1818
defload_selector(filename,**kwargs):
19-
input_path=os.path.join(os.path.dirname(__file__),"_static",filename)
20-
withopen(input_path,encoding="utf-8")asinput_file:
21-
returnSelector(text=input_file.read(),**kwargs)
19+
input_path=Path(__file__).parent/"_static"/filename
20+
returnSelector(text=input_path.read_text(encoding="utf-8"),**kwargs)
2221

2322

2423
defsetup(namespace):

‎parsel/__init__.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"xpathfuncs",
1414
]
1515

16-
fromparselimportxpathfuncs# NOQA
17-
fromparsel.csstranslatorimportcss2xpath# NOQA
18-
fromparsel.selectorimportSelector,SelectorList# NOQA
16+
fromparselimportxpathfuncs
17+
fromparsel.csstranslatorimportcss2xpath
18+
fromparsel.selectorimportSelector,SelectorList
1919

2020
xpathfuncs.setup()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp