Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add isort check in pre-commit and GitHub CI (DEV-2707) #529

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/tests-on-push.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from typing import Any
import warnings
from typing import Any

import regex

Expand Down