Skip to content

Commit

Permalink
Migrate to ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
miaow2 committed Oct 25, 2023
1 parent 86fb7bf commit 17447ce
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install -r requirements/dev.txt
- name: Run black
run: black --check --diff --color .
- name: Run ruff format
run: ruff format
- name: Run ruff
run: ruff .

Expand Down
9 changes: 3 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
args: [--check, --diff, --color, .]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.280
rev: v0.1.2
hooks:
- id: ruff
args: [netbox_config_diff]
- id: ruff-format
exclude: migrations
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[![NetBox version](https://img.shields.io/badge/NetBox-3.5|3.6-blue.svg)](https://github.com/netbox-community/netbox)
[![Supported Versions](https://img.shields.io/pypi/pyversions/netbox-config-diff.svg)](https://pypi.org/project/netbox-config-diff/)
[![PyPI version](https://badge.fury.io/py/netbox-config-diff.svg)](https://badge.fury.io/py/netbox-config-diff)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![CI](https://github.com/miaow2/netbox-config-diff/actions/workflows/commit.yaml/badge.svg?branch=develop)](https://github.com/miaow2/netbox-config-diff/actions)
Expand Down
15 changes: 4 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,17 @@ dependencies = {file = ["requirements/base.txt"]}
optional-dependencies.dev = { file = ["requirements/dev.txt"] }
optional-dependencies.test = { file = ["requirements/test.txt"] }

[tool.black]
line-length = 120
skip-string-normalization = true
exclude = '''
(
/(
migrations
)/
)
'''

[tool.ruff]
exclude = ["migrations", "__pycache__"]
select = ["C", "E", "F", "I"]
ignore = ["C901"]
line-length = 120
target-version = "py310"

[tool.ruff.format]
line-length = 120
exclude =['migrations']

[tool.pytest.ini_options]
addopts = "-p no:warnings -vv --no-migrations"
DJANGO_SETTINGS_MODULE = "netbox.settings"
Expand Down
3 changes: 1 addition & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
black==23.10.0
ruff==0.1.0
ruff==0.1.2

0 comments on commit 17447ce

Please sign in to comment.