Skip to content

Commit

Permalink
Merge pull request #20 from pmorissette/tkp/ruff
Browse files Browse the repository at this point in the history
Update ruff usage, add isort
  • Loading branch information
timkpaine authored May 8, 2024
2 parents 88b5f62 + 60a8a3d commit e27604d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@ develop:
python -m pip install nbconvert

lint:
python -m ruff klink setup.py docs/source/conf.py
python -m isort --check klink setup.py docs/source/conf.py
python -m ruff check klink setup.py docs/source/conf.py
python -m ruff format --check klink setup.py docs/source/conf.py

fix:
python -m isort klink setup.py docs/source/conf.py
python -m ruff format klink setup.py docs/source/conf.py

clean:
- rm -rf build
- rm -rf dist
- rm -rf klink.egg-info

css:
lessc klink/less/klink.less klink/static/css/klink.css
- cp klink/static/css/klink.css docs/build/html/_static/css/klink.css
cp klink/static/css/klink.css docs/build/html/_static/css/klink.css

docs: css
docs:
$(MAKE) -C docs/ clean
$(MAKE) -C docs/ html
$(MAKE) css

serve:
cd docs/build/html; \
Expand Down
4 changes: 2 additions & 2 deletions klink/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from subprocess import call
import shutil
import re
import shutil
from subprocess import call


def convert_notebooks():
Expand Down
1 change: 0 additions & 1 deletion klink/demo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class TestClass(object):

"""
This is a test class. Used for demo purposes.
Expand Down
14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
[tool.isort]
combine_as_imports = true
include_trailing_comma = true
line_length = 180
profile = "black"

default_section = "THIRDPARTY"
sections = "FUTURE,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"

known_first_party = "klink"


[tool.ruff]
line-length = 180

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def local_file(filename):
],
extras_require={
"dev": [
"ruff",
"isort>=5,<6",
"ruff>=0.3,<0.4",
"twine",
"wheel",
],
},
packages=["klink"],
Expand Down

0 comments on commit e27604d

Please sign in to comment.