From: Martin Skorupski Date: Sun, 12 Nov 2023 17:06:21 +0000 (+0100) Subject: linting ... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=a2b078aa43c03151b01b97b421ff1dc21b04c555;p=oam.git linting ... - prepare project for linting and test Issue-ID: OAM-388 Change-Id: I8729a848f157f771329791805697d1dd2c1f4546 Signed-off-by: Martin Skorupski --- diff --git a/code/network-generator/CONTRIBUTING.md b/code/network-generator/CONTRIBUTING.md index d045207..c062074 100644 --- a/code/network-generator/CONTRIBUTING.md +++ b/code/network-generator/CONTRIBUTING.md @@ -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 diff --git a/code/network-generator/Makefile b/code/network-generator/Makefile index 9b2c745..78ac7ca 100644 --- a/code/network-generator/Makefile +++ b/code/network-generator/Makefile @@ -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 index 0000000..1ccf0ad --- /dev/null +++ b/code/network-generator/mkdocs.yml @@ -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 index 0000000..7aca30f --- /dev/null +++ b/code/network-generator/requirements-test.txt @@ -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