Skip to content

Commit

Permalink
chore: add isort check in pre-commit and GitHub CI (DEV-2707) (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Sep 26, 2023
1 parent 9699710 commit 89ef086
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests-on-push.yml
Expand Up @@ -62,6 +62,9 @@ jobs:
- name: Linting with black
run: poetry run black --check .

- name: Linting with isort
run: poetry run isort . --check --diff

- name: Linting with darglint
run: poetry exec darglint

Expand Down
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Expand Up @@ -2,7 +2,7 @@

repos:
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.9.1
hooks:
- id: black
# It is recommended to specify the latest version of Python supported by your project here,
Expand Down Expand Up @@ -38,7 +38,12 @@ repos:
- id: text-unicode-replacement-char

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
rev: v0.37.0
hooks:
- id: markdownlint
args: [--config, .markdownlint.yml, --ignore, CHANGELOG.md]

- repo: https://github.com/PyCQA/isort
rev: 5.11.5
hooks:
- id: isort
6 changes: 6 additions & 0 deletions pyproject.toml
Expand Up @@ -53,6 +53,7 @@ types-jsonschema = "^4.17.0.10"
types-openpyxl = "^3.1.0.15"
types-regex = "^2023.8.8.0"
types-pyyaml = "^6.0.12.11"
isort = "^5.12.0"


[tool.poetry.scripts]
Expand Down Expand Up @@ -120,6 +121,11 @@ exclude = [
line-length = 120


[tool.isort]
profile = "black"
line_length = 120


[tool.pylint.MASTER]
ignore-paths = ["src/dsp_tools/models/resource.py"] # TODO: activate this
suggestion-mode = true
Expand Down
2 changes: 1 addition & 1 deletion src/dsp_tools/models/connection.py
@@ -1,6 +1,6 @@
import json
from dataclasses import dataclass
from datetime import datetime
import json
from pathlib import Path
from typing import Any, Optional, cast

Expand Down
2 changes: 1 addition & 1 deletion src/dsp_tools/utils/excel2json/resources.py
Expand Up @@ -8,9 +8,9 @@
import pandas as pd
import regex

import dsp_tools.utils.excel2json.utils as utl
from dsp_tools.models.exceptions import UserError
from dsp_tools.utils.shared import check_notna, prepare_dataframe
import dsp_tools.utils.excel2json.utils as utl

languages = ["en", "de", "fr", "it", "rm"]

Expand Down
2 changes: 1 addition & 1 deletion src/dsp_tools/utils/project_get.py
@@ -1,6 +1,6 @@
import json
from typing import Any
import warnings
from typing import Any

import regex

Expand Down

0 comments on commit 89ef086

Please sign in to comment.