Skip to content

Commit 58b436f

Browse files
authored
Migrate to ruff (#150)
* Add pyupgrade. * Bump tool versions. * Migrate to ruff. * Simplify typing casts. * Cleanup pylintrc. * More cleanup. * Move tool configs to pyproject.toml. * Update the nitpicky config. * Exclude TYPE_CHECKING blocks from coverage. * Remove an extra newline.
1 parent 0b3b9f2 commit 58b436f

17 files changed

+463
-417
lines changed

.bandit.yml

-6
This file was deleted.

.bumpversion.cfg

-6
This file was deleted.

.coveragerc

-10
This file was deleted.

.flake8

-16
This file was deleted.

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
tox -e py
2525
2626
- name: Upload coverage report
27-
run: bash <(curl -s https://codecov.io/bash)
27+
uses: codecov/codecov-action@v5

.isort.cfg

-2
This file was deleted.

.pre-commit-config.yaml

+5-16
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.4
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

cssselect/__init__.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# -*- coding: utf-8 -*-
21
"""
3-
CSS Selectors based on XPath
4-
============================
2+
CSS Selectors based on XPath
3+
============================
54
6-
This module supports selecting XML/HTML elements based on CSS selectors.
7-
See the `CSSSelector` class for details.
5+
This module supports selecting XML/HTML elements based on CSS selectors.
6+
See the `CSSSelector` class for details.
87
98
10-
:copyright: (c) 2007-2012 Ian Bicking and contributors.
11-
See AUTHORS for more details.
12-
:license: BSD, see LICENSE for more details.
9+
:copyright: (c) 2007-2012 Ian Bicking and contributors.
10+
See AUTHORS for more details.
11+
:license: BSD, see LICENSE for more details.
1312
1413
"""
1514

@@ -27,10 +26,10 @@
2726
"FunctionalPseudoElement",
2827
"GenericTranslator",
2928
"HTMLTranslator",
30-
"parse",
3129
"Selector",
3230
"SelectorError",
3331
"SelectorSyntaxError",
32+
"parse",
3433
)
3534

3635
VERSION = "1.2.0"

0 commit comments

Comments
 (0)