Skip to content
Snippets Groups Projects
Commit 2c7de3d5 authored by Lars Kruse's avatar Lars Kruse Committed by David Trattnig
Browse files

style: add configuration and Makefile for black, flake8, isort and codespell

parent a5e3df45
No related branches found
No related tags found
1 merge request!1Style & Tests
[flake8]
max-line-length = 99
exclude = config/, python/, src/rest/, .tox/
ignore = E121,E123,E126,E203,E226,E24,E704,W503,N802
Makefile 0 → 100644
SPELLING_PATHS = $(wildcard *.md) docs src
SPELLING_EXCLUDE_FILENAME = .codespell-excludes
SPELLING_IGNORE_WORDS_FILENAME = .codespell-ignore-words
.PHONY: help
help:
@echo "Supported targets:"
@echo " lint - verify code style"
@echo " spelling - check spelling of text"
@echo " style - apply automatic formatting"
@echo
.PHONY: lint
lint:
python3 -m flake8 .
.PHONY: spelling
spelling:
codespell \
--exclude-file "$(SPELLING_EXCLUDE_FILENAME)" \
--ignore-words "$(SPELLING_IGNORE_WORDS_FILENAME)" \
$(SPELLING_PATHS)
.PHONY: style
style:
python3 -m isort .
black .
[tool.black]
target-version = ["py38"]
# TODO: Use extend-exclude as soon as Debian Bookworm is released.
exclude = '''
^/src/rest/
| ^/config/
| ^/python/
| ^/.tox/
'''
[tool.isort]
py_version = 38
profile = "black"
# TODO: switch to "extend_skip", after Debian Bookworm is released
skip = [
"config",
"node_modules",
"python",
"src/rest/",
".git",
".tox",
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment