diff --git a/.gitignore b/.gitignore index b6e4761..1f00741 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,7 @@ dmypy.json # Pyre type checker .pyre/ + +# all files with "_dnm." in them like foo_dnm.py (dnm = do not merge) +*_dnm.* + diff --git a/batch/test.bat b/batch/test.bat index 04a069f..2fc4363 100644 --- a/batch/test.bat +++ b/batch/test.bat @@ -1,4 +1,21 @@ @echo off -cd test -pytest +IF "%1"=="fmt" ( + :: Format the code using Black and Autoflake + black --config=pyproject.toml . + autoflake --config=pyproject.toml . +) ELSE IF "%1" == "test" ( + :: Run tests using pytest + cd test + pytest + cd .. +) ELSE IF "%1"=="cov" ( + :: Generate code coverage + cd test + coverage run -m pytest + coverage xml -o coverage.xml + coverage html + cd .. +) ELSE ( + echo Invalid flag. Please specify a valid flag. +) diff --git a/pyproject.toml b/pyproject.toml index ca29ef1..115d291 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,11 @@ line-length = 100 skip-magic-trailing-comma = true include = '\.py$' +quiet = true + +[tool.isort] +profile = "black" +line_length = 100 [autoflake] ignore_init_module_imports = true diff --git a/requirements.format.txt b/requirements.format.txt new file mode 100644 index 0000000..a85c907 --- /dev/null +++ b/requirements.format.txt @@ -0,0 +1,3 @@ +black==23.3.0 +autoflake==2.1.1 +isort==5.12.0 \ No newline at end of file