Skip to content

Commit

Permalink
Migrate to ruff (#150)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
wRAR authored Feb 3, 2025
1 parent 0b3b9f2 commit 58b436f
Show file tree
Hide file tree
Showing 17 changed files with 463 additions and 417 deletions.
6 changes: 0 additions & 6 deletions .bandit.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .bumpversion.cfg

This file was deleted.

10 changes: 0 additions & 10 deletions .coveragerc

This file was deleted.

16 changes: 0 additions & 16 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
tox -e py
- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)
uses: codecov/codecov-action@v5
2 changes: 0 additions & 2 deletions .isort.cfg

This file was deleted.

21 changes: 5 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
hooks:
- id: bandit
args: [-r, -c, .bandit.yml]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/psf/black.git
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- id: ruff
args: [ --fix ]
- id: ruff-format
17 changes: 8 additions & 9 deletions cssselect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
"""
CSS Selectors based on XPath
============================
CSS Selectors based on XPath
============================
This module supports selecting XML/HTML elements based on CSS selectors.
See the `CSSSelector` class for details.
This module supports selecting XML/HTML elements based on CSS selectors.
See the `CSSSelector` class for details.
:copyright: (c) 2007-2012 Ian Bicking and contributors.
See AUTHORS for more details.
:license: BSD, see LICENSE for more details.
:copyright: (c) 2007-2012 Ian Bicking and contributors.
See AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""

Expand All @@ -27,10 +26,10 @@
"FunctionalPseudoElement",
"GenericTranslator",
"HTMLTranslator",
"parse",
"Selector",
"SelectorError",
"SelectorSyntaxError",
"parse",
)

VERSION = "1.2.0"
Expand Down
Loading

0 comments on commit 58b436f

Please sign in to comment.