Skip to content

Commit

Permalink
dev: remove isort usage throughout the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofavorito authored and marcofavoritobi committed Aug 24, 2023
1 parent 7a1e9b0 commit 09835a8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 41 deletions.
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- name: Code style check
run: |
tox -e black-check
tox -e isort-check
tox -e flake8
tox -e vulture
tox -e darglint
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,14 @@ make safety
make bandit
```

- To apply [`black`](https://black.readthedocs.io/en/stable/) and [`isort`](https://pycqa.github.io/isort/index.html) code formatters:
- To apply [`black`](https://black.readthedocs.io/en/stable/) code formatter:
```
make black
make isort
```

- whereas, to only check compliance:
```
make black-check
make isort-check
```

- To run tests: `make test`.
Expand Down
18 changes: 2 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ clean-test: ## remove test and coverage artifacts
rm -fr .mypy_cache
rm -fr coverage.xml

lint-all: black isort flake8 static bandit safety vulture darglint pylint ## run all linters
lint-all: black flake8 static bandit safety vulture darglint pylint ## run all linters

lint-all-files: black-files isort-files flake8-files static-files bandit-files vulture-files darglint-files pylint-files ## run all linters for specific files (specified with files="file1 file2 somedir ...")
lint-all-files: black-files flake8-files static-files bandit-files vulture-files darglint-files pylint-files ## run all linters for specific files (specified with files="file1 file2 somedir ...")

flake8: ## check style with flake8
flake8 black_it tests scripts examples
Expand All @@ -75,20 +75,6 @@ static-files: ## static type checking with mypy for specific files (specified wi
$(call check_defined, files)
mypy $(files)

isort: ## sort import statements with isort
isort black_it tests scripts examples

isort-files: ## sort import statements with isort for specific files (specified with files="file1 file2 somedir ...")
$(call check_defined, files)
isort $(files)

isort-check: ## check import statements order with isort
isort --check-only black_it tests scripts examples

isort-check-files: ## check import statements order with isort for specific files (specified with files="file1 file2 somedir ...")
$(call check_defined, files)
isort --check-only $(files)

black: ## apply black formatting
black black_it tests scripts examples

Expand Down
9 changes: 0 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ exclude =
max-complexity = 10
max-line-length = 120

[isort]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
ensure_newline_before_comments=True
known_third_party=xgboost

[black]
exclude = "scripts/whitelists/"

Expand Down
13 changes: 1 addition & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
isolated_build = True
envlist = bandit, safety, check-copyright, black-check, isort-check, vulture, flake8, mypy, pylint, py3{8,9,10}, docs
envlist = bandit, safety, check-copyright, black-check, vulture, flake8, mypy, pylint, py3{8,9,10}, docs

[tox:.package]
# note tox will use the same python version as under what tox is installed to package
Expand Down Expand Up @@ -48,7 +48,6 @@ deps =
flake8-bugbear==23.3.12
flake8-docstrings==1.7.0
flake8-eradicate==1.5.0
flake8-isort==6.0.0
pydocstyle==6.3.0
commands =
flake8 black_it tests scripts examples
Expand Down Expand Up @@ -80,16 +79,6 @@ skip_install = True
deps = black==23.7.0
commands = black black_it tests scripts examples --check --verbose

[testenv:isort]
skip_install = True
deps = isort==5.12.0
commands = isort black_it tests scripts examples

[testenv:isort-check]
skip_install = True
deps = isort==5.12.0
commands = isort --check-only black_it tests scripts examples

[testenv:bandit]
skipsdist = True
skip_install = True
Expand Down

0 comments on commit 09835a8

Please sign in to comment.