From 48510369522f1a400c7ec19180245dad47b985ed Mon Sep 17 00:00:00 2001 From: Sagar Paul Date: Mon, 15 May 2023 21:17:48 +0530 Subject: [PATCH] add supporting files (#266) * add supporting files * add dictionary txt --- .config/dictionary.txt | 28 ++++++++++++++++++++++++ .darglint | 7 ++++++ .flake8 | 49 +++++++++++++++++++++++++++++++++++++----- .prettierignore | 2 ++ cspell.config.yaml | 36 +++++++++++++++++++++++++++++++ mypy.ini | 30 ++++++++++++++++++++++++++ tox-ansible.ini | 0 7 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 .config/dictionary.txt create mode 100644 .darglint create mode 100644 cspell.config.yaml create mode 100644 mypy.ini create mode 100644 tox-ansible.ini diff --git a/.config/dictionary.txt b/.config/dictionary.txt new file mode 100644 index 0000000..4d4455b --- /dev/null +++ b/.config/dictionary.txt @@ -0,0 +1,28 @@ +antsichaut +argspec +astimezone +autoupdate +basepython +cdcp +cidrblock +cmds +dataclass +devel +endgroup +envname +envtmpdir +etime +extraheader +fileh +isoformat +nolabel +notesdir +passenv +returncode +setenv +setuptools +suboptions +tmpvtm +toxfile +toxinidir +tracebackhide diff --git a/.darglint b/.darglint new file mode 100644 index 0000000..8e68aa3 --- /dev/null +++ b/.darglint @@ -0,0 +1,7 @@ +[darglint] +# NOTE: All `darglint` styles except for `sphinx` hit ridiculously low +# NOTE: performance on some of the in-project Python modules. +# Refs: +# * https://github.com/terrencepreilly/darglint/issues/186 +docstring_style = sphinx +strictness = full diff --git a/.flake8 b/.flake8 index 4ae8bd9..4795515 100644 --- a/.flake8 +++ b/.flake8 @@ -7,27 +7,66 @@ count = true # Don't even try to analyze these: extend-exclude = + # No need to traverse egg info dir + *.egg-info, + # tool cache dirs + *_cache # project env vars .env, # GitHub configs .github, + # Cache files of MyPy + .mypy_cache, # Cache files of pytest .pytest_cache, - # Occasional virtualenv dirs + # Temp dir of pytest-testmon + .tmontmp, + # Occasional virtualenv dir .venv - venv # VS Code .vscode, + # Temporary build dir + build, + # This contains sdists and wheels of ansible-navigator that we don't want to check + dist, + # Metadata of `pip wheel` cmd is autogenerated + pip-wheel-metadata, + # adjacent venv + venv + # ansible won't let me + __init__.py # IMPORTANT: avoid using ignore option, always use extend-ignore instead # Completely and unconditionally ignore the following errors: extend-ignore = - E203, # annoy black by allowing white space before : https://github.com/psf/black/issues/315 - E402, # ansible requires import after doc strings - E501, # given the ansible_collections this is nearly impossible + # Safeguard neutering of flake8-quotes : https://github.com/zheller/flake8-quotes/issues/105 + Q, + # annoy black by allowing white space before : https://github.com/psf/black/issues/315 + E203, + # duplicate of pylint W0611 (unused-import) + F401, + # duplicate of pylint E0602 (undefined-variable) + F821, + # duplicate of pylint W0612 (unused-variable) + F841, # Accessibility/large fonts and PEP8 unfriendly: max-line-length = 100 +# Allow certain violations in certain files: +# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future +per-file-ignores = + # The following ignores have been researched and should be considered permanent + # each should be preceeded with an explanation of each of the error codes + # If other ignores are added for a specific file in the section following this, + # these will need to be added to that line as well. + + + # S101: Allow the use of assert within the tests directory, since tests require it. + tests/**.py: S101 + + # The following were present during the initial implementation. + # They are expected to be fixed and unignored over time. + # Count the number of occurrences of each error/warning code and print a report: statistics = true diff --git a/.prettierignore b/.prettierignore index 3b7645e..3c756a2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,4 +14,6 @@ venv.bak/ # A linked collection directory created by pytest-ansible-units collections/ +tests/output/ + README.md diff --git a/cspell.config.yaml b/cspell.config.yaml new file mode 100644 index 0000000..6563af9 --- /dev/null +++ b/cspell.config.yaml @@ -0,0 +1,36 @@ +dictionaryDefinitions: + - name: words + path: .config/dictionary.txt + addWords: true +dictionaries: + - bash + - networking-terms + - python + - words + - "!aws" + - "!backwards-compatibility" + - "!cryptocurrencies" + - "!cpp" +ignorePaths: + # All dot files in the root + - \.* + # This file + - cspell.config.yaml + # Generated rst files in the docs directory + - docs/*.rst + # The mypy configuration file + - mypy.ini + # The shared file for tool configuration + - pyproject.toml + # requirements.txt + - requirements.txt + # test-requirements.txt + - test-requirements.txt + # the bindep file + - bindep.txt + # The tox configuration file + - tox.ini + +languageSettings: + - languageId: python + allowCompoundWords: false diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..cd56a58 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,30 @@ +[mypy] +files = + plugins/, + tests/ +install_types = true +namespace_packages = true +no_implicit_optional = true +non_interactive = true +pretty = true +show_column_numbers = true +show_error_codes = true +show_error_context = true +strict = true +strict_optional = true + +[mypy-ansible.*] +# No type hints as of version 2.12 +ignore_missing_imports = true + +[mypy-ansible_collections.ansible.utils.*] +# No type hints as of version 2.6.1 +ignore_missing_imports = true + +[mypy-pytest_ansible_network_integration] +# No type hints as of 6/8/2022 +ignore_missing_imports = true + +[mypy-ansible_collections.*] +# Collections are not python package +ignore_missing_imports = true diff --git a/tox-ansible.ini b/tox-ansible.ini new file mode 100644 index 0000000..e69de29