diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 8ccd1e3..a9595ec 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -58,7 +58,6 @@ jobs: matrix: ${{ fromJson(needs.pre.outputs.matrix) }} steps: - - uses: actions/checkout@v3 with: fetch-depth: 0 # needed by setuptools-scm diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 77f5f77..7cc5627 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,21 @@ ci: # https://github.com/pre-commit-ci/issues/issues/55 - codecov repos: + - repo: https://github.com/pre-commit/mirrors-prettier + # keep it before yamllint + rev: v3.0.0-alpha.4 + hooks: + - id: prettier + # Temporary excludes so we can gradually normalize the formatting + exclude: > + (?x)^( + tests/.*.html + )$ + always_run: true + additional_dependencies: + - prettier + - prettier-plugin-toml + - prettier-plugin-sort-json - repo: local hooks: - id: codecov @@ -37,7 +52,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - id: mixed-line-ending - - id: check-byte-order-marker + - id: fix-byte-order-marker - id: check-executables-have-shebangs - id: check-merge-conflict - id: debug-statements @@ -54,22 +69,22 @@ repos: - flake8-pytest-style>=1.5.0 language_version: python3 - repo: https://github.com/pycqa/pylint - rev: v2.15.9 + rev: v2.16.0b0 hooks: - id: pylint - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.991 hooks: - - id: mypy - # empty args needed in order to match mypy cli behavior - args: ["--strict"] - additional_dependencies: - - pytest - - types-setuptools - - types-pkg_resources - - types-mock - exclude: > - (?x)^( - docs/.*| - setup.py - )$ + - id: mypy + # empty args needed in order to match mypy cli behavior + args: ["--strict"] + additional_dependencies: + - pytest + - types-setuptools + - types-pkg_resources + - types-mock + exclude: > + (?x)^( + docs/.*| + setup.py + )$ diff --git a/ansi2html/style.py b/ansi2html/style.py index 72a18bd..347504d 100644 --- a/ansi2html/style.py +++ b/ansi2html/style.py @@ -274,7 +274,7 @@ def get_styles( raise ValueError(f"Unsupported color scheme {scheme!r}") from e if len(pal) < 16: - raise Exception( + raise RuntimeError( f"Color scheme {scheme!r} specifies fewer than 16 colors. 16 colors are required." ) diff --git a/pyproject.toml b/pyproject.toml index 06df3c8..a17ee9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,5 @@ [build-system] -requires = [ - "setuptools >= 45.0.0", - "setuptools_scm[toml] >= 7.0.0", -] +requires = ["setuptools >= 45.0.0", "setuptools_scm[toml] >= 7.0.0"] build-backend = "setuptools.build_meta" [tool.isort] @@ -13,31 +10,30 @@ warn_return_any = true warn_unused_configs = true [tool.pylint."MESSAGES CONTROL"] - disable = [ - # TODO(ssbarnea): remove temporary skips adding during initial adoption: - "attribute-defined-outside-init", - "consider-using-dict-comprehension", - "consider-using-enumerate", - "consider-using-f-string", - "deprecated-module", - "import-error", - "invalid-name", - "line-too-long", - "missing-class-docstring", - "missing-function-docstring", - "missing-module-docstring", - "redefined-builtin", - "redefined-outer-name", - "too-few-public-methods", - "too-many-arguments", - "too-many-branches", - "too-many-instance-attributes", - "too-many-locals", - "too-many-public-methods", - "too-many-statements", - "unused-argument", - "unused-variable", + # TODO(ssbarnea): remove temporary skips adding during initial adoption: + "attribute-defined-outside-init", + "consider-using-dict-comprehension", + "consider-using-enumerate", + "consider-using-f-string", + "deprecated-module", + "import-error", + "invalid-name", + "line-too-long", + "missing-class-docstring", + "missing-function-docstring", + "missing-module-docstring", + "redefined-builtin", + "redefined-outer-name", + "too-few-public-methods", + "too-many-arguments", + "too-many-branches", + "too-many-instance-attributes", + "too-many-locals", + "too-many-public-methods", + "too-many-statements", + "unused-argument", + "unused-variable", ] [tool.pylint.REPORTS]