Skip to content

Commit

Permalink
Add pre-commit config and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotzbua authored and florianfesti committed Mar 22, 2024
1 parent 2a1a7d5 commit d01f8bf
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 42 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/typing.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: requirements-txt-fixer
- id: check-case-conflict
- id: detect-private-key
Expand All @@ -30,6 +33,55 @@ repos:
- id: pyupgrade
args: [ --py38-plus ]

- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
- id: autoflake
args: [ --remove-all-unused-imports, --in-place, --ignore-pass-statements, ]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

# A lot todo to pass test.
#- repo: https://github.com/PyCQA/flake8
# rev: 6.1.0
# hooks:
# - id: flake8
# additional_dependencies: [ flake8-bugbear ]
# args: [ '--extend-ignore=E402,E501,E201,E202,E203,E221,E225,E231,E261,E266,E302,E305' ]
# # additional_dependencies: [ flake8-bugbear, flake8-docstrings ]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
hooks:
- id: mypy
args: [ '--ignore-missing-imports' ]
files: '^boxes/.*\.py$'
- id: mypy
args: [ '--ignore-missing-imports' ]
files: '^documentation/src/boxes2rst.py$'
- id: mypy
args: [ '--ignore-missing-imports' ]
files: '^scripts/boxes$'
- id: mypy
args: [ '--ignore-missing-imports' ]
files: '^scripts/boxes2inkscape$'
- id: mypy
args: [ '--ignore-missing-imports' ]
files: '^scripts/boxes2pot$'
- id: mypy
args: [ '--ignore-missing-imports' ]
files: '^scripts/boxes_proxy.py$'
- id: mypy
args: [ '--ignore-missing-imports' ]
additional_dependencies: [ 'types-Markdown' ]
files: '^scripts/boxesserver$'
- id: mypy
args: [ '--ignore-missing-imports' ]
files: '^setup.py$'

- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.0
hooks:
Expand Down
11 changes: 7 additions & 4 deletions scripts/boxes_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@
License: GNU GPL v3
"""
import inkex
import sys
import os
import subprocess
from lxml import etree
import sys
import tempfile
from shlex import quote

from inkex.extensions import GenerateExtension
from lxml import etree

import inkex

class boxesPyWrapper(inkex.GenerateExtension):

class boxesPyWrapper(GenerateExtension):
def add_arguments(self, pars):
args = sys.argv[1:]
for arg in args:
Expand Down

0 comments on commit d01f8bf

Please sign in to comment.