diff --git a/.ecrc b/.ecrc new file mode 100644 index 0000000..f0c91f7 --- /dev/null +++ b/.ecrc @@ -0,0 +1,23 @@ +{ + "Verbose": false, + "Debug": false, + "IgnoreDefaults": false, + "SpacesAftertabs": false, + "NoColor": false, + "Exclude": [ + "LICENSE", + "\\.initializers", + "\\.vscode" + ], + "AllowedContentTypes": [], + "PassedFiles": [], + "Disable": { + // set these options to true to disable specific checks + "EndOfLine": false, + "Indentation": false, + "InsertFinalNewline": false, + "TrimTrailingWhitespace": false, + "IndentSize": true, + "MaxLineLength": false + } +} diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..83a86a2 --- /dev/null +++ b/.flake8 @@ -0,0 +1,7 @@ +[flake8] +max-line-length = 100 +extend-ignore = E203, W503 +per-file-ignores = + configuration/*:E131,E251,E266,E302,E305,E501,E722 + startup_scripts/startup_script_utils/__init__.py:F401 + docker/*:E266,E722 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f7f9a23..bfecd01 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,6 +9,28 @@ on: - release jobs: + lint: + runs-on: ubuntu-latest + name: Checks syntax of our code + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - name: Lint Code Base + uses: github/super-linter@v3 + env: + DEFAULT_BRANCH: develop + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SUPPRESS_POSSUM: true + LINTER_RULES_PATH: / + VALIDATE_ALL_CODEBASE: false + VALIDATE_DOCKERFILE: false + + EDITORCONFIG_FILE_NAME: .ecrc + DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yaml + MARKDOWN_CONFIG_FILE: .markdown-lint.yml + PYTHON_BLACK_CONFIG_FILE: pyproject.toml + PYTHON_FLAKE8_CONFIG_FILE: .flake8 + PYTHON_ISORT_CONFIG_FILE: pyproject.toml build: continue-on-error: ${{ matrix.docker_from == 'alpine:edge' }} strategy: diff --git a/.gitignore b/.gitignore index 6eada06..07859bb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ configuration/* configuration/ldap/* !configuration/ldap/ldap_config.py prometheus.yml +super-linter.log diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..610e431 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,3 @@ +ignored: +- DL3006 +- DL3018 diff --git a/.markdown-lint.yml b/.markdown-lint.yml new file mode 100644 index 0000000..beebc4b --- /dev/null +++ b/.markdown-lint.yml @@ -0,0 +1,2 @@ +MD013: false +MD041: false diff --git a/pyproject.toml b/pyproject.toml index 3b48bae..cc932eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,11 @@ [tool.black] -line-length = 100 +line_length = 100 target-version = ['py38'] include = '\.pyi?$' exclude = ''' - ( /( - \.eggs # exclude a few common directories in the - | \.git # root of the project + \.git | \.venv | \.netbox | \.vscode @@ -19,3 +17,10 @@ exclude = ''' [tool.isort] profile = "black" multi_line_output = 3 +line_length = 100 + +[tool.pylint.messages_control] +disable = "C0330, C0326" + +[tool.pylint.format] +max-line-length = "100"