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 7, 2023
1 parent 1eccc85 commit ca8206a
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 103 deletions.
15 changes: 0 additions & 15 deletions .flake8

This file was deleted.

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/gort --count --show-source --statistics
pip install ruff
ruff check src/ tests/
- name: Lint with black
run: |
pip install black
black --check src/gort
- name: Lint with isort
run: |
pip install isort
isort -c src/gort
- name: Test with pytest
run: |
pip install pytest pytest-mock pytest-asyncio pytest-cov
Expand Down
3 changes: 1 addition & 2 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os

from pkg_resources import parse_version

from gort import __version__
from pkg_resources import parse_version


# Are we building in RTD?
Expand Down
94 changes: 27 additions & 67 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 17 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,16 @@ rich = "^13.4.2"
[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 @@ -71,20 +68,29 @@ nox = ">=2021.6.12"
sphinx-autobuild = ">=2021.3.14"
pyds9 = "^1.8.1"
sphinx-autodoc-typehints = "^1.23.2"
ruff = "^0.0.282"

[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 = "gort"
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" = ["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 gort --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/coordinates/__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/time/__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/units/__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 ca8206a

Please sign in to comment.