From 154c923f1f4d600b2e8a7cbdb45b09be67b03af2 Mon Sep 17 00:00:00 2001 From: Marcello Perathoner Date: Mon, 25 Sep 2023 00:08:28 +0200 Subject: [PATCH] Small fixes to dev environment --- .editorconfig | 21 +++++++++++++++++++++ Makefile | 4 ++-- requirements-dev.txt | 1 + tests/conftest.py | 5 ++++- 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d4a2c44 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +end_of_line = lf + +[*.bat] +indent_style = tab +end_of_line = crlf + +[LICENSE] +insert_final_newline = false + +[Makefile] +indent_style = tab diff --git a/Makefile b/Makefile index f655563..2173956 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ profile: $(BIN)python -O -m scripts.profile docs: - cd docs; make html + cd docs; make SPHINXBUILD='../$(BIN)python -msphinx' html tox: $(BIN)tox @@ -68,7 +68,7 @@ uninstall: $(BIN)pip uninstall suffix_tree clean: - -rm -rf dist build *.egg-info + -rm -rf dist build htmlcov .mypy_cache .pytest_cache .tox *.egg-info -rm docs/_images/badge*.svg -rm *~ .*~ pylintgraph.dot -find . -name __pycache__ -type d -exec rm -r "{}" \; diff --git a/requirements-dev.txt b/requirements-dev.txt index c642ff5..e5c7797 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,6 +2,7 @@ black blackdoc build coverage[toml] +hatchling mypy pydocstyle pylint diff --git a/tests/conftest.py b/tests/conftest.py index 094f364..7e9c278 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -52,6 +52,7 @@ def __init__(self, option_strings, dest, nargs=None, **kwargs): super().__init__(option_strings, dest, **kwargs) def __call__(self, parser, namespace, values, option_string=None): + """This is called if the --debug-mode option is passed to pytest.""" if option_string in self.option_strings: util.DEBUG = True util.DEBUG_LABELS = True @@ -60,7 +61,9 @@ def __call__(self, parser, namespace, values, option_string=None): def pytest_addoption(parser): - parser.addoption("--performance", action="store_true", help="run performance tests") + parser.addoption( + "--performance", action="store_true", help="run performance tests" + ) parser.addoption( "--debug-mode", action=DebugAction, help="turn on DEBUG mode while testing" )