Skip to content

Commit

Permalink
Move isort/black exclusions to pyproject.toml. Run isort and black.
Browse files Browse the repository at this point in the history
  • Loading branch information
aholmes committed Oct 5, 2023
1 parent 9261413 commit 0f6e4e3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,8 @@ jobs:

- name: Check code style
run: |
black \
--exclude 'src/.+/typings' \
--check src
black --check src
- name: Check import order
run: |
isort \
--check-only \
--skip src/*/typings \
src
isort --check-only src
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,10 @@ addopts = [
python_files = "test_*.py"

norecursedirs = "__pycache__ build .pytest_cache *.egg-info .venv"

[tool.black]
exclude = "src/.+/(typings|build)"

[tool.isort]
profile = "black"
skip_glob = ["src/*/typings", "src/*/build"]
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import sys
import logging
import sys
from typing import Any

from injector import Binder, Module
from typing_extensions import override


class LoggerModule(Module):
def __init__(self, name: str | None = None, log_level: int = logging.INFO, log_to_stdout: bool = False) -> None:
def __init__(
self,
name: str | None = None,
log_level: int = logging.INFO,
log_to_stdout: bool = False,
) -> None:
super().__init__()
self._logger = logging.getLogger(name)
self._logger.setLevel(log_level)
Expand Down
6 changes: 4 additions & 2 deletions src/web/BL_Python/web/scaffolding/scaffolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@

from BL_Python.programming.collections.dict import merge
from jinja2 import BaseLoader, Environment, PackageLoader, Template

# fmt: off
from pkg_resources import \
ResourceManager # pyright: ignore[reportUnknownVariableType,reportGeneralTypeIssues]
from pkg_resources import (
ResourceManager, # pyright: ignore[reportUnknownVariableType,reportGeneralTypeIssues]
)
from pkg_resources import get_provider

# fmt: on
Expand Down

0 comments on commit 0f6e4e3

Please sign in to comment.