Skip to content

Commit

Permalink
ci: replace black with ruff formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasberbuer committed Apr 8, 2024
1 parent a53b84b commit 99dd3c1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
python-version: ${{ matrix.python }}
- name: Install Tox
run: pip install tox
- name: Run black
run: tox -e black
- name: Run ruff formatter
run: tox -e ruff-format
- name: Run ruff
run: tox -e ruff
- name: Run mypy
Expand Down
5 changes: 1 addition & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ repos:
exclude: ^tests/output/
- id: trailing-whitespace
exclude: ^tests/output/
- repo: "https://github.com/psf/black"
rev: 24.3.0
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: ruff-format
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: "https://github.com/pre-commit/mirrors-mypy"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![PyPI](https://img.shields.io/pypi/v/conan-check-updates)](https://pypi.org/project/conan-check-updates)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/conan-check-updates)](https://pypi.org/project/conan-check-updates)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Check for updates of your `conanfile.txt` / `conanfile.py` requirements.

Expand Down Expand Up @@ -36,6 +36,7 @@ for line in usage.splitlines():
cog.outl(line)
cog.outl("```")
]]] -->

```
usage: conan-check-updates [--cwd CWD] [--target {major,minor,patch}]
[--timeout TIMEOUT] [-u] [-V] [-h]
Expand All @@ -62,6 +63,7 @@ options:
-V, --version Show the version and exit.
-h, --help Show this message and exit.
```

<!-- [[[end]]] -->

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion docs/generate_screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

HERE = Path(__file__).parent

URL_TERMSHOT = "https://github.com/homeport/termshot/releases/download/v0.2.5/termshot_0.2.5_linux_amd64.tar.gz" # noqa, pylint: disable=line-too-long
URL_TERMSHOT = "https://github.com/homeport/termshot/releases/download/v0.2.5/termshot_0.2.5_linux_amd64.tar.gz"

CONANFILE = """
[requires]
Expand Down
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ tests = [
"pytest-rerunfailures",
]
tools = [
"black",
"cogapp>=3",
"mypy>=0.9", # pyproject.toml support
"pre-commit",
Expand Down Expand Up @@ -122,18 +121,18 @@ source = ["src", ".tox/*/site-packages"]
legacy_tox_ini = """
[tox]
envlist =
black
ruff-format
ruff
mypy
py{37, 38, 39, 310, 311, 312}-{v1, v2}
coverage-report
[testenv:black]
[testenv:ruff-format]
skip_install = true
deps = black
deps = ruff
commands =
black --diff .
black --check .
ruff format --diff .
ruff format --check .
[testenv:ruff]
skip_install = true
Expand Down
2 changes: 1 addition & 1 deletion src/conan_check_updates/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class VersionRange:
- https://github.com/npm/node-semver
- https://github.com/conan-io/conan/blob/develop2/conans/model/version_range.py
- https://github.com/conan-io/conan/blob/develop2/conans/test/unittests/model/version/test_version_range.py
""" # noqa, pylint: disable=line-too-long
"""

def __init__(self, value: str):
self._str = value
Expand Down

0 comments on commit 99dd3c1

Please sign in to comment.