Skip to content

Commit

Permalink
Lint with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Aug 11, 2023
1 parent 835f7e7 commit 5965b01
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 206 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,16 @@ jobs:
pip install --upgrade wheel pip setuptools
pip install .
- name: Lint with flake8
- name: Lint with ruff
run: |
pip install flake8
flake8 src/lvmguider --count --show-source --statistics
pip install ruff
ruff check .
- name: Lint with black
run: |
pip install black
black --check src/lvmguider
- name: Lint with isort
run: |
pip install isort
isort -c src/lvmguider
- name: Test with pytest
run: |
pip install pytest pytest-mock pytest-asyncio pytest-cov
Expand Down
353 changes: 166 additions & 187 deletions poetry.lock

Large diffs are not rendered by default.

28 changes: 17 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,16 @@ simple-pid = "^2.0.0"
[tool.poetry.group.dev.dependencies]
ipython = ">=8.0.0"
matplotlib = ">=3.1.1"
flake8 = ">=3.7.9"
doc8 = ">=0.8.0"
pytest = ">=5.2.2"
pytest-asyncio = ">=0.10.0"
pytest-cov = ">=2.8.1"
pytest-mock = ">=1.13.0"
pytest-sugar = ">=0.9.2"
isort = ">=4.3.21"
coverage = {version = ">=5.0", extras = ["toml"]}
ipdb = ">=0.12.3"
rstcheck = ">=3.3.1"
black = ">=20.8b1"
jedi = ">=0.17.2"
Sphinx = ">=4.0.0"
furo = ">=2021.9.22"
sphinx-copybutton = ">=0.4.0"
Expand All @@ -66,20 +63,29 @@ myst-parser = ">=0.15.2"
nox = ">=2021.6.12"
sphinx-autobuild = ">=2021.3.14"
pandas-stubs = ">=2.0.2.230605"
ruff = ">=0.0.284"

[tool.black]
line-length = 88
target-version = ['py311']
fast = true

[tool.isort]
profile = "black"
sections = ["FUTURE", "STDLIB", "TYPING", "THIRDPARTY", "SDSS", "FIRSTPARTY", "LOCALFOLDER"]
default_section = "THIRDPARTY"
known_first_party = "lvmguider"
known_typing = ["typing"]
known_sdss = ["sdsstools", "clu"]
lines_after_imports = 2
[tool.ruff]
line-length = 88
target-version = 'py311'
select = ["E", "F", "I"]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401", "F403", "E402"]

[tool.ruff.isort]
known-first-party = ["ifoo"]
lines-after-imports = 2
section-order = ["future", "standard-library", "typing", "third-party", "sdss", "first-party", "local-folder"]

[tool.ruff.isort.sections]
typing = ["typing"]
sdss = ["sdsstools", "clu"]

[tool.pytest.ini_options]
addopts = "--cov lvmguider --cov-report xml --cov-report html --cov-report term -W ignore"
Expand Down
1 change: 1 addition & 0 deletions typings/astropy/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Any


def __getattr__(name: str) -> Any: ...
1 change: 1 addition & 0 deletions typings/astropy/io/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Any


def __getattr__(name: str) -> Any: ...
1 change: 1 addition & 0 deletions typings/astropy/io/fits/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Any


def __getattr__(name: str) -> Any: ...
1 change: 1 addition & 0 deletions typings/astropy/wcs/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Any


def __getattr__(name: str) -> Any: ...

0 comments on commit 5965b01

Please sign in to comment.