linting ... 41/12041/1
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Sun, 12 Nov 2023 17:06:21 +0000 (18:06 +0100)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Sun, 12 Nov 2023 17:06:29 +0000 (18:06 +0100)
- prepare project for linting and test

Issue-ID: OAM-388
Change-Id: I8729a848f157f771329791805697d1dd2c1f4546
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
code/network-generator/CONTRIBUTING.md
code/network-generator/Makefile
code/network-generator/mkdocs.yml [new file with mode: 0644]
code/network-generator/requirements-test.txt [new file with mode: 0644]

index d045207..c062074 100644 (file)
@@ -19,6 +19,11 @@ This instructions are for linux base systems. (Linux, MacOS, BSD, etc.)
 ```
 pip install isort
 pip install black
+pip install mypy
+pip install flake8
+pip install pytest
+pip install coverage
+pip install pytest-cov
 ```
 
 ## Setting up your own virtual environment
index 9b2c745..78ac7ca 100644 (file)
@@ -24,8 +24,8 @@ install:          ## Install the project in dev mode.
        @echo "Don't forget to run 'make virtualenv' if you got errors."
        $(ENV_PREFIX)pip install -e .[test]
 
-.PHONY: fmt
-fmt:              ## Format code using black & isort.
+.PHONY: format
+format:              ## Format code using black & isort.
        $(ENV_PREFIX)isort network_generation/
        $(ENV_PREFIX)black -l 79 network_generation/
        $(ENV_PREFIX)black -l 79 tests/
@@ -33,9 +33,10 @@ fmt:              ## Format code using black & isort.
 .PHONY: lint
 lint:             ## Run pep8, black, mypy linters.
        $(ENV_PREFIX)flake8 network_generation/
+       $(ENV_PREFIX)flake8 tests/
        $(ENV_PREFIX)black -l 79 --check network_generation/
        $(ENV_PREFIX)black -l 79 --check tests/
-       $(ENV_PREFIX)mypy --ignore-missing-imports network_generation/
+       $(ENV_PREFIX)mypy --ignore-missing-imports --disallow-untyped-defs --check-untyped-def network_generation/
 
 .PHONY: test
 test: lint        ## Run tests and generate coverage report.
diff --git a/code/network-generator/mkdocs.yml b/code/network-generator/mkdocs.yml
new file mode 100644 (file)
index 0000000..1ccf0ad
--- /dev/null
@@ -0,0 +1,2 @@
+site_name: network_generation
+theme: readthedocs
diff --git a/code/network-generator/requirements-test.txt b/code/network-generator/requirements-test.txt
new file mode 100644 (file)
index 0000000..7aca30f
--- /dev/null
@@ -0,0 +1,24 @@
+# Copyright 2023 highstreet technologies GmbH
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This requirements are for development and testing only, not for production.
+pytest
+coverage
+flake8
+black
+isort
+pytest-cov
+mypy
+gitchangelog
+mkdocs