diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 52140c4..9216656 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,14 +1,8 @@ -name: Lint w/ black, ruff +name: Lint w/ ruff on: [push, pull_request] jobs: - black: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: psf/black@stable - ruff: runs-on: ubuntu-latest steps: @@ -16,7 +10,7 @@ jobs: - name: Install Python uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/Makefile b/Makefile index 7e61ee6..6ac1513 100644 --- a/Makefile +++ b/Makefile @@ -32,14 +32,12 @@ upload: .PHONY: lint-fix lint-fix: - pip3 install -q -r requirements-dev.txt - isort . - black . - ruff check --fix habanero + source .env/bin/activate; \ + pip3 install -q -r requirements-dev.txt; \ + ruff check --select I --fix habanero .PHONY: lint-check lint-check: + source ./.env/bin/activate; \ pip3 install -q -r requirements-dev.txt - isort . --check-only - black . --check ruff check habanero diff --git a/README.rst b/README.rst index df48640..a9be1c8 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ habanero ======== -|pypi| |docs| |ghactions| |coverage| |black| +|pypi| |docs| |ghactions| |coverage| |ruff| This is a low level client for working with Crossref's search API. It's been named to be more generic, as other organizations are/will adopt Crossref's search API, making it possible to interact with all from one client. @@ -142,15 +142,20 @@ Meta .. |pypi| image:: https://badge.fury.io/py/habanero.svg :target: https://badge.fury.io/py/habanero + :alt: pypi .. |docs| image:: https://readthedocs.org/projects/habanero/badge/?version=latest :target: http://habanero.rtfd.org/ + :alt: Docs .. |ghactions| image:: https://github.com/sckott/habanero/actions/workflows/python.yml/badge.svg?branch=main :target: https://github.com/sckott/habanero/actions/workflows/python.yml + :alt: ghactions .. |coverage| image:: https://codecov.io/gh/sckott/habanero/branch/main/graph/badge.svg?token=6RrgNAuQmR :target: https://codecov.io/gh/sckott/habanero + :alt: coverage -.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black +.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json + :target: https://github.com/astral-sh/ruff + :alt: Ruff diff --git a/pyproject.toml b/pyproject.toml index 842d66c..9457300 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,11 +10,11 @@ exclude = [ "dist" ] -ignore = [ +lint.ignore = [ "D102", ] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "__init__.py" = ["E402", "F401", "F403"] "habanero/request_class.py" = ["E722"] "test/*" = ["E501"] diff --git a/requirements-dev.txt b/requirements-dev.txt index 118e66e..e43c0da 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1 @@ ruff==0.3.4 -black==24.3.0 -isort==5.13.2