diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..56549e5fc4fb75a202321aa648316e188fd07ec0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,34 @@ +# Config is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style for every file +[*] +# Set default charset +charset = utf-8 +end_of_line = lf +# Do not insert final new line at the end of file +insert_final_newline = false +# Automatically remove trailing space at end of line +trim_trailing_whitespace = true +# Size of indentation (either tabs or space) +indent_size = 2 + +# Python specific syntax +[*.py] +# Type of indentation (either tabs or space) +indent_style = space +# Size of indentation (either tabs or space) +indent_size = 4 +# Maximum length (in number of chars) for a line +max_line_length = 80 + +# Yaml specific syntax +[*.{yaml,yml}] +# Type of indentation (either tabs or space) +indent_style = space +# Size of indentation (either tabs or space) +indent_size = 2 +# Maximum length (in number of chars) for a line +max_line_length = 120 diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000000000000000000000000000000000000..3495186795ee7116502158bdce32069a5e392003 --- /dev/null +++ b/.yamllint @@ -0,0 +1,41 @@ +--- +# Based on ansible-lint config +extends: default + +ignore: | + .* + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + colons: + max-spaces-after: -1 + level: error + commas: + max-spaces-after: -1 + level: error + comments: disable + comments-indentation: disable + document-start: disable + empty-lines: + max: 3 + level: error + hyphens: + level: error + indentation: disable + key-duplicates: enable + line-length: disable + new-line-at-end-of-file: disable + new-lines: + type: unix + trailing-spaces: disable + truthy: disable + +# ***************************************************************************** +# VIM MODELINE +# vim: ft=yaml: fdm=indent: +# ***************************************************************************** diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..f527ad6c0e785ca1fa02d00f9fb54f5ac9806578 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,1229 @@ +# No need for [build-system] as this pyproject.toml per PEP-518 as this file +# serve to a centralized configuration file for development tools such as +# black, flake8/flakehell, pylint, pycodestyle, etc. +[build-system] +requires = [ + "setuptools", + "wheel" +] +build-backend = "setuptools.build_meta" + +# ----------------------------------------------------------------------------- +# Tox (Test automation) configuration +# https://tox.readthedocs.io/en/latest/# +[tool.tox] +legacy_tox_ini=""" +# Global configuration +[tox] +isolated_build=true +skipsdist=true +envlist=format_{python,shell},build_doc + +[testenv:format_python] +# Allow external commands +allowlist_externals= + /usr/bin/bash +skip_install=true +deps = + -r./requirements.prod.txt + -r./requirements.dev.txt +commands = + # Automatically sort import in python files + isort . + # Automatically format code + black ./ + # Lint python files using pylint + bash -c '\ + pylint \ + $(find . -type f \\( \ + -name "*.py" \ + -not -path "./.*" \ + -not -path "./docs/theme/*" \ + -not -path "./python_venv/*" \ + -not -path "./tmp/*" \ + -not -path "./site**/*" \\) )' + # Lint python files using flake8 + flakehell lint + # Ensure docstring convention (google is mkdocs rendering documentation) + pydocstyle --count --match-dir="(?![^\\.(docs)]).*" --convention=google + +[testenv:format_shell] +# Allow external commands +allowlist_externals= + /usr/bin/bash +skip_install=true +deps = + -r./requirements.prod.txt + -r./requirements.dev.txt +commands = + # Linter bash script using shellcheck + bash -c '\ + shellcheck \ + -s bash \ + -x \ + $(find . -type f \\( \ + -name "*.sh" \ + -not -path "./.*" \ + -not -path "./python_venv/*" \\) ) ' + bash -c 'DIRENV_ROOT="$(pwd)" ./tools/generate_source_docs.sh --dry-run' + + +[testenv:build_doc] +# Allow external commands +allowlist_externals= + /usr/bin/bash + /usr/bin/rm +skip_install=true +deps = + -r./requirements.docs.txt +commands = + # Ensure build of documentation website is working + mkdocs build -d site_local + # If everything went right, remove build site + rm -rf site_local + bash -c '\ + if [[ -f "mkdocs.local.yml" ]]; \ + then \ + mkdocs build -f mkdocs.local.yml -d site_monorepo; \ + rm -rf site_monorepo; \ + fi' +""" + + +### BEGIN MKDOCS TEMPLATE ### +### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG ! ### +### Modified content will be overwritten when updating. ### + +# ----------------------------------------------------------------------------- +# Pytest configuration +# https://docs.pytest.org/en/latest/customize.html?highlight=pyproject#pyproject-toml +[tool.pytest.ini_options] + # TODO: Find online documentation about this option. +ignore=[".tox",".direnv", "python_venv"] + + # Sets list of directories that should be searched for tests when no specific + # directories, files or test ids are given in the command line when executing + # pytest from the rootdir directory. Useful when all project tests are in a + # known location to speed up test collection and to avoid picking up undesired + # tests by accident. +testpaths=[ "test" ] + +# ----------------------------------------------------------------------------- +# For sorting imports +# https://timothycrosley.github.io/isort/ +[tool.isort] + # Tells isort to set the known standard library based on the specified Python + # version. Default is to assume any Python 3 version could be the target, and use + # a union of all stdlib modules across versions. If auto is specified, the + # version of the interpreter used to run isort (currently: 38) will be used. + # Default:`py3` +#py_version="py3" + + # Force specific imports to the top of their appropriate section. + # Default: `frozenset()` +#force_to_top=[] + + # Files that sort imports should skip over. If you want to skip multiple files + # you should specify twice: --skip file1 --skip file2. + # Default: `('.bzr', '.direnv', '.eggs', '.git', '.hg', '.mypy_cache', '.nox', + # '.pants.d', '.svn', '.tox', '.venv', '_build', 'buck-out', 'build', 'dist', + # 'node_modules', 'venv')` +skip=['.bzr', + '.direnv', + '.eggs', + '.git', + '.hg', + '.mypy_cache', + '.nox', + '.pants.d', + '.svn', + '.tox', + '.venv', + '_build', + 'buck-out', + 'build', + 'dist', + 'node_modules', + 'venv', + 'python_venv'] + + # Files that sort imports should skip over. + # Default: frozenset() +#skip_glob=[] + + # Treat project as a git repository and ignore files listed in .gitignore + # Default: `False` +skip_gitignore=true + + # The max length of an import line (used for wrapping long imports). + # Default: `79` +line_length=80 + + # Specifies how long lines that are wrapped should be, if not set line_length is + # used. NOTE: wrap_length must be LOWER than or equal to line_length. + # Default: `0` +#wrap_length=0 + + # Forces line endings to the specified value. If not set, values will be guessed + # per-file. + # Default: `` +#line_ending + + # Order of import + # Default:`('FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER')` +#sections= + + # Put all imports into the same section bucket + # Default: `False` +#no_sections=false + + # Force isort to recognize a module as part of Python's internal future + # compatibility libraries. WARNING: this overrides the behavior of __future__ + # handling and therefore can result in code that can't execute. If you're looking + # to add dependencies such as six a better option is to create a another section + # below --future using custom sections. See: + # https://github.com/PyCQA/isort#custom-sections-and-ordering and the discussion + # here: https://github.com/PyCQA/isort/issues/1463. + # Default: `('__future__',)` +#known_future_library= + + # Force isort to recognize a module as being part of a third party library. + # Default: `frozenset()` +#known_third_party= + + # Force isort to recognize a module as being part of the current python project. + # Default: `frozenset()` +#known_first_party= + + # Force isort to recognize a module as being a local folder. Generally, this is + # reserved for relative imports (from . import module). + # Default: `frozenset()` +#known_local_folder= + + # Force isort to recognize a module as part of Python's standard library. + # Default: `('_dummy_thread', '_thread', 'abc', 'aifc', 'argparse', 'array', + # 'ast', 'asynchat', 'asyncio', 'asyncore', 'atexit', 'audioop', 'base64', + # 'bdb', 'binascii', 'binhex', 'bisect', 'builtins', 'bz2', 'cProfile', + # 'calendar', 'cgi', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', + # 'codeop', 'collections', 'colorsys', 'compileall', 'concurrent', + # 'configparser', 'contextlib', 'contextvars', 'copy', 'copyreg', 'crypt', + # 'csv', 'ctypes', 'curses', 'dataclasses', 'datetime', 'dbm', 'decimal', + # 'difflib', 'dis', 'distutils', 'doctest', 'dummy_threading', 'email', + # 'encodings', 'ensurepip', 'enum', 'errno', 'faulthandler', 'fcntl', 'filecmp', + # 'fileinput', 'fnmatch', 'formatter', 'fpectl', 'fractions', 'ftplib', + # 'functools', 'gc', 'getopt', 'getpass', 'gettext', 'glob', 'graphlib', 'grp', + # 'gzip', 'hashlib', 'heapq', 'hmac', 'html', 'http', 'imaplib', 'imghdr', + # 'imp', 'importlib', 'inspect', 'io', 'ipaddress', 'itertools', 'json', + # 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'lzma', 'macpath', + # 'mailbox', 'mailcap', 'marshal', 'math', 'mimetypes', 'mmap', 'modulefinder', + # 'msilib', 'msvcrt', 'multiprocessing', 'netrc', 'nis', 'nntplib', 'ntpath', + # 'numbers', 'operator', 'optparse', 'os', 'ossaudiodev', 'parser', 'pathlib', + # 'pdb', 'pickle', 'pickletools', 'pipes', 'pkgutil', 'platform', 'plistlib', + # 'poplib', 'posix', 'posixpath', 'pprint', 'profile', 'pstats', 'pty', 'pwd', + # 'py_compile', 'pyclbr', 'pydoc', 'queue', 'quopri', 'random', 're', + # 'readline', 'reprlib', 'resource', 'rlcompleter', 'runpy', 'sched', 'secrets', + # 'select', 'selectors', 'shelve', 'shlex', 'shutil', 'signal', 'site', 'smtpd', + # 'smtplib', 'sndhdr', 'socket', 'socketserver', 'spwd', 'sqlite3', 'sre', + # 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stat', 'statistics', + # 'string', 'stringprep', 'struct', 'subprocess', 'sunau', 'symbol', 'symtable', + # 'sys', 'sysconfig', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', + # 'termios', 'test', 'textwrap', 'threading', 'time', 'timeit', 'tkinter', + # 'token', 'tokenize', 'trace', 'traceback', 'tracemalloc', 'tty', 'turtle', + # 'turtledemo', 'types', 'typing', 'unicodedata', 'unittest', 'urllib', 'uu', + # 'uuid', 'venv', 'warnings', 'wave', 'weakref', 'webbrowser', 'winreg', + # 'winsound', 'wsgiref', 'xdrlib', 'xml', 'xmlrpc', 'zipapp', 'zipfile', + # 'zipimport', 'zlib', 'zoneinfo')` +#known_standard_library= + + # Extra modules to be included in the list of ones in Python's standard library. + # Default: `frozenset()` +#extra_standard_library= + + # No Description + # ----- Example `pyproject.toml` + # ``` + # [tool.isort] + # sections=['FUTURE', 'STDLIB', 'THIRDPARTY', 'AIRFLOW', 'FIRSTPARTY', 'LOCALFOLDER'] + # known_airflow=['airflow'] + # ``` + # Default: `{}` +#known_other= + + # Multi line output (0-grid, 1-vertical, 2-hanging, 3-vert-hanging, 4-vert-grid, + # 5-vert-grid-grouped, 6-vert-grid-grouped-no-comma, 7-noqa, + # 8-vertical-hanging-indent-bracket, 9-vertical-prefix-from-module-import, + # 10-hanging-indent-with-parentheses). + # Default: `WrapModes.GRID` +multi_line_output=3 + + # No Description** + # Default: `()` +#forced_separate= + + # String to place for indents defaults to " " (4 spaces). + # Default: ` ` +#indent= + + # No Description + # Default: ` #` +#comment_prefix= + + # Sort imports by their string length. + # Default: `False` +#length_sort=false + + # Sort straight imports by their string length. Similar to `length_sort` but + # applies only to straight imports and doesn't affect from imports. + # Default: `False` +#length_sort_straight=false + + # No Description + # Default: `frozenset()` +#length_sort_sections=[] + + # Adds the specified import line to all files, automatically determining correct + # placement. + # Default: `frozenset()` +#add_imports=[] + + # Removes the specified import from all files. + # Default: `frozenset()` +#remove_imports=[] + + # Only adds the imports specified in --add-import if the file contains existing + # imports. + # Default: `False` +#append_only=false + + # Reverse order of relative imports. + # Default: `False` +#reverse_relative=false + + # Forces all from imports to appear on their own line + # Default: `False` +#force_single_line=false + + # One or more modules to exclude from the single line rule. + # Default: `()` +#single_line_exclusions=[] + + # Sets the default section for import options: ('FUTURE', 'STDLIB', + # 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER') + # Default: `THIRDPARTY` +#default_section="THIRDPARTY + + # No Description + # Default: `{}` +#import_headings=[] + + # Balances wrapping to produce the most consistent line length possible + # Default: `False` +#balanced_wrapping=false + + # Use parentheses for line continuation on length limit instead of slashes. + # **NOTE**: This is separate from wrap modes, and only affects how individual + # lines that are too long get continued, not sections of multiple imports. + # Default: `False` +use_parentheses=true + + # Order imports by type, which is determined by case, in addition to alphabetically. + # **NOTE**: type here refers to the implied type from the import name + # capitalization. isort does not do type introspection for the imports. These + # "types" are simply: CONSTANT_VARIABLE, CamelCaseClass, variable_or_function. + # If your project follows PEP8 or a related coding standard and has many imports + # this is a good default, otherwise you likely will want to turn it off. From + # the CLI the `--dont-order-by-type` option will turn this off. + # Default:*`True` +#order_by_type=true + + # Ensures the output doesn't save if the resulting file contains syntax errors. + # Default: `False` +#atomic=false + + # Lines after inmports + # Default: `-1` +#lines_after_imports=-1 + + # Lines Between Sections + # Default: `1` +#lines_between_sections=1 + + # Lines Between Types + # Default: `0` +#lines_between_types=0 + + # Combines as imports on the same line. + # Default: `False` +#combine_as_imports=false + + # Ensures that if a star import is present, nothing else is imported from that + # namespace. + # Default: `False` +#combine_star=false + + # Includes a trailing comma on multi line imports that include parentheses. + # Default: `False` +include_trailing_comma=true + + # Switches the typical ordering preference, showing from imports first then + # straight ones. + # Default: `False` +#from_first=false + + # Shows verbose output, such as when files are skipped or when a check is + # successful. + # Default: `False` +#verbose=false + + # Shows extra quiet output, only errors are outputted. + # Default:`False` +#quiet=false + + # Forces import adds even if the original file is empty. + # Default: `False` +#force_adds=false + + # Force all imports to be sorted alphabetically within a section + # Default: `False` +#force_alphabetical_sort_within_sections= false + + # Force all imports to be sorted as a single section + # Default: `False` +#force_alphabetical_sort=false + + # Force number of from imports (defaults to 2 when passed as CLI flag without + # value)to be grid wrapped regardless of line length. If 0 is passed in (the + # global default) only line length is considered. + # Default: `0` +force_grid_wrap=0 + + # Don't sort straight-style imports (like import sys) before from-style imports + # (like from itertools import groupby). Instead, sort the imports by module, + # independent of import style. + # Default: `False` +#force_sort_within_sections=false + + # Lexicographical + # Default: `False` +#lexicographical=false + + # Group By Package + # Default: `False` +#group_by_package=false + + # Tells isort to ignore whitespace differences when --check-only is being used. + # Default: `False` +#ignore_whitespace+false + + # Sections which should not be split with previous by empty lines + # Default: `frozenset()` +#no_lines_before=[] + + # Leaves `from` imports with multiple imports 'as-is' (e.g. `from foo import a, + # c ,b`). + # Default: `False` +#no_inline_sort=false + + # Ignore Comments + # Default: `False` +#ignore_comments=false + + # Tells isort to include casing when sorting module names + # Default: `False` +#case_sensitive=false + + # Sources + # Default: `()` +#sources=[] + + # Virtual environment to use for determining whether a package is third-party + # Default: `` +#virtual_env= + + # Conda environment to use for determining whether a package is third-party + # Default: `` +#conda_env= + + # Inserts a blank line before a comment following an import. + # Default: `False` +#ensure_newline_before_comments=false + + # Directory + # Default: `` +#directory+ + + # Profile + # Base profile type to use for configuration. Profiles include: black, django, + # pycharm, google, open_stack, plone, attrs, hug. As well as any shared profiles. + # Default: `` +profile="black" + + # Tells isort to honor noqa comments to enforce skipping those comments. + # Default: `False` +#honor_noqa=false + + # Add an explicitly defined source path (modules within src paths have their + # imports automatically categorized as first_party). + # Default: `()` +src_paths=["src"] + + # Use the old deprecated finder logic that relies on environment introspection magic. + # Default: `False` +#old_finders=false + + # Tells isort to remove redundant aliases from imports, such as `import os as + # os`. This defaults to `False` simply because some projects use these seemingly + # useless aliases to signify intent and change behaviour. + # Default: `False` +#remove_redundant_aliases=false + + # Causes all non-indented imports to float to the top of the file having its + # imports sorted (immediately below the top of file comment). + # This can be an excellent shortcut for collecting imports every once in a while + # when you place them in the middle of a file to avoid context switching. + # *NOTE*: It currently doesn't work with cimports and introduces some extra + # over-head and a performance penalty. + # Default: `False` +#float_to_top=false + + # Tells isort to filter files even when they are explicitly passed in as part of + # the CLI command. + # Default: `False` +#filter_files=false + + # Specifies the name of a formatting plugin to use when producing output. + # Default: `` +#formatter + + # Formatting Function + # Default: `None` +#formatting_function=None + + # Color Output + # Tells isort to use color in terminal output. + # Default: `False` +color_output=true + + # Tells isort to treat the specified single line comment(s) as if they are code. + # Default: `frozenset()` +#treat_comments_as_code=[] + + # Tells isort to treat all single line comments as if they are code. + # Default: `False` +#treat_all_comments_as_code=false + + # Specifies what extensions isort can be ran against. + # Default: `('pxd', 'py', 'pyi', 'pyx')` +#supported_extensions=['pxd', 'py', 'pyi', 'pyx'] + + # Specifies what extensions isort can never be ran against. + # Default: `('pex',)` +#blocked_extensions=["pex"] + + # Constants + # Default: `frozenset()` +#constants + + # Classes + # Default: `frozenset()` +#classes + + # Variables + # Default: `frozenset()` +#variables + + # Tells isort to only show an identical custom import heading comment once, even + # if there are multiple sections with the comment set. + # Default: `False` +#dedup_headings=false + + # Causes imports to be sorted only based on their sections like + # STDLIB,THIRDPARTY etc. Imports are unaltered and keep their relative positions + # within the different sections. + # Default: `False` +#only_sections=false + + # Suppresses verbose output for non-modified files. + # Default: `False` +#only_modified=false + + # Combines all the bare straight imports of the same section in a single line. + # Won't work with sections which have 'as' imports + # Default: `False` +#combine_straight_imports=false + + # Auto Identify Namespace Packages + # Default: `True` +#auto_identify_namespace_packages+true + + # Namespace Packages + # Default: `frozenset()` +#namespace_packages + + # Follow Links + # Default: `True` +#follow_links= + +# ----------------------------------------------------------------------------- +# Black (Optionless formatter) configuration +# https://black.readthedocs.io/en/stable/index.html +[tool.black] + # How many characters per line to allow. +line-length=80 + + # Python versions that should be supported by Black's output +target-version=['py38'] + + # A regular expression that matches files and directories that should be + # included on recursive searches. An empty value means all files are included + # regardless of the name. Use forward slashes for directories on all platforms + # (Windows, too). Exclusions are calculated first, inclusions later. +include='\.pyi?$' + + # A regular expression that matches files and directories that should be + # excluded on recursive searches. An empty value means no paths are excluded. + # Use forward slashes for directories on all platforms (Windows, too). + # Exclusions are calculated first, inclusions later. +exclude=''' +( + /( + \.eggs # exclude a few common directories in the + | \.eggs-info + | \.git # root of the project + | \.tox + | \.venv + | \.sha1 + | \.direnv/python_venv + | \.direnv/.sha1 + | python_venv + | build + | dist + | site + | site.tox + )/ +) +''' + +# ----------------------------------------------------------------------------- +# Pylint configuration +# Automatically generated with 'pylint --generate-rcfile' +# https://pylint.readthedocs.io/en/latest/index.html +[tool.pylint.'MASTER'] + # A comma-separated list of package or module names from where C extensions may + # be loaded. Extensions are loading into the active Python interpreter and may + # run arbitrary code. +extension-pkg-whitelist=[] + + # Specify a score threshold to be exceeded before program exits with error. +fail-under=10 + + # Add files or directories to the blacklist. They should be base names, not + # paths. +ignore=[".tox",".direnv", "python_venv"] + + # Add files or directories matching the regex patterns to the blacklist. The + # regex matches against base names, not paths. +ignore-patterns=[] + + # Python code to execute, usually for sys.path manipulation such as + # pygtk.require(). + # init-hook= + # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the + # number of processors available to use. +jobs=0 + + # Control the amount of potential inferred values when inferring a single + # object. This can help the performance when dealing with large functions or + # complex, nested conditions. +limit-inference-results=100 + + # List of plugins (as comma separated values of python module names) to load, + # usually to register additional checkers. +load-plugins=[] + + # Pickle collected data for later comparisons. +persistent=true + + # When enabled, pylint would attempt to guess common misconfiguration and emit + # user-friendly hints instead of false-positive error messages. +suggestion-mode=true + + # Allow loading of arbitrary C extensions. Extensions are imported into the + # active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=false + +[tool.pylint.'MESSAGES CONTROL'] + # Only show warnings with the listed confidence levels. Leave empty to show + # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. +confidence=[] + + # Disable the message, report, category or checker with the given id(s). You + # can either give multiple identifiers separated by comma (,) or put this + # option multiple times (only on the command line, not in the configuration + # file where it should appear only once). You can also use "--disable=all" to + # disable everything first and then reenable specific checks. For example, if + # you want to run only the similarities checker, you can use "--disable=all + # --enable=similarities". If you want to run only the classes checker, but have + # no Warning level messages displayed, use "--disable=all --enable=classes + # --disable=W". +disable=[] + + # Enable the message, report, category or checker with the given id(s). You can + # either give multiple identifier separated by comma (,) or put this option + # multiple time (only on the command line, not in the configuration file where + # it should appear only once). See also the "--disable" option for examples. +enable=["c-extension-no-member"] + +[tool.pylint.'REPORTS'] + # Python expression which should return a score less than or equal to 10. You + # have access to the variables 'error', 'warning', 'refactor', and 'convention' + # which contain the number of messages in each category, as well as 'statement' + # which is the total number of statements analyzed. This score is used by the + # global evaluation report (RP0004). +evaluation="10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)" + + # Template used to display messages. This is a python new-style format string + # used to format the message information. See doc for all details. +#msg-template= + + # Set the output format. Available formats are text, parseable, colorized, json + # and msvs (visual studio). You can also give a reporter class, e.g. + # mypackage.mymodule.MyReporterClass. +output-format="text" + + # Tells whether to display a full report or only the messages. +reports=false + + # Activate the evaluation score. +score=true + + +[tool.pylint.'REFACTORING'] + # Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + # Complete name of functions that never returns. When checking for + # inconsistent-return-statements if a never returning function is called then + # it will be considered as an explicit return statement and no message will be + # printed. +never-returning-functions=["sys.exit"] + + +[tool.pylint.'TYPECHECK'] + # List of decorators that produce context managers, such as + # contextlib.contextmanager. Add to this list to register other decorators that + # produce valid context managers. +contextmanager-decorators=["contextlib.contextmanager"] + + # List of members which are set dynamically and missed by pylint inference + # system, and so shouldn't trigger E1101 when accessed. Python regular + # expressions are accepted. +generated-members=[] + + # Tells whether missing members accessed in mixin class should be ignored. A + # mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=true + + # Tells whether to warn about missing members when the owner of the attribute + # is inferred to be None. +ignore-none=true + + # This flag controls whether pylint should warn about no-member and similar + # checks whenever an opaque object is returned when inferring. The inference + # can return multiple potential results while evaluating a Python object, but + # some branches might not be evaluated, which results in partial inference. In + # that case, it might be useful to still emit no-member and other checks for + # the rest of the inferred objects. +ignore-on-opaque-inference=true + + # List of class names for which member attributes should not be checked (useful + # for classes with dynamically set attributes). This supports the use of + # qualified names. +ignored-classes=["optparse.Values","thread._local","_thread._local"] + + # List of module names for which member attributes should not be checked + # (useful for modules/projects where namespaces are manipulated during runtime + # and thus existing member attributes cannot be deduced by static analysis). It + # supports qualified module names, as well as Unix pattern matching. +ignored-modules=[] + + # Show a hint with possible names when a member name was not found. The aspect + # of finding the hint is based on edit distance. +missing-member-hint=true + + # The minimum edit distance a name should have in order to be considered a + # similar match for a missing member name. +missing-member-hint-distance=1 + + # The total number of similar names that should be taken in consideration when + # showing a hint for a missing member. +missing-member-max-choices=1 + + # List of decorators that change the signature of a decorated function. +signature-mutators=[] + + +[tool.pylint.'VARIABLES'] + # List of additional names supposed to be defined in builtins. Remember that + # you should avoid defining new builtins when possible. +additional-builtins=[] + + # Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=true + + # List of strings which can identify a callback function by name. A callback + # name must start or end with one of those strings. +callbacks=["cb_","_cb"] + + # A regular expression matching the name of dummy variables (i.e. expected to + # not be used). +#dummy-variables-rgx="+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_" + + # Argument names that match this expression will be ignored. Default to name + # with leading underscore. +ignored-argument-names="_.*|^ignored_|^unused_" + + # Tells whether we should check for unused import in __init__ files. +init-import=false + + # List of qualified module names which can have objects that can redefine + # builtins. +redefining-builtins-modules=["six.moves","past.builtins","future.builtins","builtins","io"] + + +[tool.pylint.'LOGGING'] + # The type of string formatting that logging methods do. `old` means using % + # formatting, `new` is for `{}` formatting. +logging-format-style="old" + + # Logging modules to check that the string format arguments are in logging + # function parameter format. +logging-modules="logging" + + +[tool.pylint.'MISCELLANEOUS'] + # List of note tags to take in consideration, separated by a comma. +notes=["FIXME","XXX","TODO"] + + # Regular expression of note tags to take in consideration. + # notes-rgx= + + +[tool.pylint.'SIMILARITIES'] + # Ignore comments when computing similarities. +ignore-comments=true + + # Ignore docstrings when computing similarities. +ignore-docstrings=true + + # Ignore imports when computing similarities. +ignore-imports=false + + # Minimum lines number of a similarity. +min-similarity-lines=4 + + +[tool.pylint.'SPELLING'] + # Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + + # Spelling dictionary name. Available dictionaries: none. To make it work, + # install the python-enchant package. +spelling-dict=[] + + # List of comma separated words that should not be checked. +spelling-ignore-words=[] + + # A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file=[] + + # Tells whether to store unknown words to the private dictionary (see the + # --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=false + + +[tool.pylint.'STRING'] + # This flag controls whether inconsistent-quotes generates a warning when the + # character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=false + + # This flag controls whether the implicit-str-concat should generate a warning + # on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=false + + +[tool.pylint.'FORMAT'] + # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format=[] + + # Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines='^\s*(# )?<?https?://\S+>?$' + + # Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + + # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 + # tab). +indent-string=' ' + + # Maximum number of characters on a single line. +max-line-length=100 + + # Maximum number of lines in a module. +max-module-lines=1000 + + # List of optional constructs for which whitespace checking is disabled. `dict- + # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. + # `trailing-comma` allows a space between comma and closing bracket: (a, ). + # `empty-line` allows space-only lines. +no-space-check=["trailing-comma","dict-separator"] + + # Allow the body of a class to be on the same line as the declaration if body + # contains single statement. +single-line-class-stmt=false + + # Allow the body of an if to be on the same line as the test if there is no + # else. +single-line-if-stmt=false + + +[tool.pylint.'BASIC'] + # Naming style matching correct argument names. +argument-naming-style="snake_case" + + # Regular expression matching correct argument names. Overrides argument- + # naming-style. +#argument-rgx= + + # Naming style matching correct attribute names. +attr-naming-style="snake_case" + + # Regular expression matching correct attribute names. Overrides attr-naming- + # style. +#attr-rgx= + + # Bad variable names which should always be refused, separated by a comma. +bad-names=["foo","bar","baz","toto","tutu","tata"] + + # Bad variable names regexes, separated by a comma. If names match any regex, + # they will always be refused +bad-names-rgxs=[] + + # Naming style matching correct class attribute names. +class-attribute-naming-style="any" + + # Regular expression matching correct class attribute names. Overrides class- + # attribute-naming-style. +#class-attribute-rgx= + + # Naming style matching correct class names. +class-naming-style="PascalCase" + + # Regular expression matching correct class names. Overrides class-naming- + # style. +#class-rgx= + + # Naming style matching correct constant names. +const-naming-style="UPPER_CASE" + + # Regular expression matching correct constant names. Overrides const-naming- + # style. +#const-rgx= + + # Minimum line length for functions/classes that require docstrings, shorter + # ones are exempt. +docstring-min-length=-1 + + # Naming style matching correct function names. +function-naming-style="snake_case" + + # Regular expression matching correct function names. Overrides function- + # naming-style. +#function-rgx= + + # Good variable names which should always be accepted, separated by a comma. +#good-names= ["i","j","k","ex","Run","_"] + + # Good variable names regexes, separated by a comma. If names match any regex, + # they will always be accepted +good-names-rgxs=[] + + # Include a hint for the correct naming format with invalid-name. +include-naming-hint=true + + # Naming style matching correct inline iteration names. +inlinevar-naming-style="any" + + # Regular expression matching correct inline iteration names. Overrides + # inlinevar-naming-style. +#inlinevar-rgx= + + # Naming style matching correct method names. +method-naming-style="snake_case" + + # Regular expression matching correct method names. Overrides method-naming- + # style. +#method-rgx= + + # Naming style matching correct module names. +module-naming-style="snake_case" + + # Regular expression matching correct module names. Overrides module-naming- + # style. +#module-rgx= + + # Colon-delimited sets of names that determine each other's naming style when + # the name regexes allow several styles. +name-group=[] + + # Regular expression which should only match function or class names that do + # not require a docstring. +no-docstring-rgx="^_" + + # List of decorators that produce properties, such as abc.abstractproperty. Add + # to this list to register other decorators that produce valid properties. + # These decorators are taken in consideration only for invalid-name. +property-classes="abc.abstractproperty" + + # Naming style matching correct variable names. +variable-naming-style="snake_case" + + # Regular expression matching correct variable names. Overrides variable- + # naming-style. + # variable-rgx= + +[tool.pylint.'IMPORTS'] + # List of modules that can be imported at any level, not just the top level + # one. +allow-any-import-level=[] + + # Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=false + + # Analyse import fallback blocks. This can be used to support both Python 2 and + # 3 compatible code, which means that the block might have code that exists + # only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=false + + # Deprecated modules which should not be used, separated by a comma. +deprecated-modules="optparse,tkinter.tix" + + # Create a graph of external dependencies in the given file (report RP0402 must + # not be disabled). +ext-import-graph=[] + + # Create a graph of every (i.e. internal and external) dependencies in the + # given file (report RP0402 must not be disabled). +import-graph=[] + + # Create a graph of internal dependencies in the given file (report RP0402 must + # not be disabled). +int-import-graph=[] + + # Force import order to recognize a module as part of the standard + # compatibility libraries. +known-standard-library=[] + + # Force import order to recognize a module as part of a third party library. +known-third-party="enchant" + + # Couples of modules and preferred modules, separated by a comma. +preferred-modules=[] + + +[tool.pylint.'CLASSES'] + # List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=["__init__","__new__","setUp","__post_init__"] + + # List of member names, which should be excluded from the protected access + # warning. +exclude-protected=["_asdict","_fields","_replace","_source","_make"] + + # List of valid names for the first argument in a class method. +valid-classmethod-first-arg="cls" + + # List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg="cls" + + +[tool.pylint.'DESIGN'] + # Maximum number of arguments for function / method. +max-args=5 + + # Maximum number of attributes for a class (see R0902). +max-attributes=7 + + # Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + + # Maximum number of branch for function / method body. +max-branches=12 + + # Maximum number of locals for function / method body. +max-locals=15 + + # Maximum number of parents for a class (see R0901). +max-parents=7 + + # Maximum number of public methods for a class (see R0904). +max-public-methods=20 + + # Maximum number of return / yield for function / method body. +max-returns=6 + + # Maximum number of statements in function / method body. +max-statements=50 + + # Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[tool.pylint.'EXCEPTIONS'] + # Exceptions that will emit a warning when being caught. Defaults to + # "BaseException, Exception". +overgeneral-exceptions=["BaseException","Exception"] + + +# ----------------------------------------------------------------------------- +# Flake8 wrapper to make it nice, legacy-friendly, configurable. +# https://flakehell.readthedocs.io/config.html +[tool.flakehell] + # Optionally inherit from remote config (or local if you want) +#base=https://url.git.com/pyproject.toml + + # Specify any flake8 options. + # Print the total number of errors. + # Default False +count=true + + # Provide a comma-separated list of glob patterns to exclude from checks. +exclude=[ + ".git", + "__pycache__", + ".eggs", + ".venv", + ".direnv", + ".tox", + ".sha1", + "build", + "dist", + "docs", + "site" +] + + # Provide a comma-separate list of glob patterns to include for checks. +filename=[ "*.py" ] + + # Select the formatter used to display errors to the user. + # This defaults to: default + # - default + # - pylint + # - grouped + # - colored + # The default formatter has a format string of: + # '%(path)s:%(row)d:%(col)d: %(code)s %(text)s' +format="grouped" + + # Toggle whether pycodestyle should enforce matching the indentation of the + # opening bracket’s line. When you specify this, it will prefer that you hang + # the closing bracket rather than match the indentation. +hang_closing=false + + # Specify a list of codes to ignore. The list is expected to be comma-separated, + # and does not need to specify an error code exactly. Since Flake8 3.0, this can + # be combined with --select. See --select for more information. + # For example, if you wish to only ignore W234, then you can specify that. But + # if you want to ignore all codes that start with W23 you need only specify W23 + # to ignore them. This also works for W2 and W (for example). + # This defaults to: E121,E123,E126,E226,E24,E704 + # REMARK: Not parsed by flakehell, use plugins +#ignore=[ "E121", "E123", "E126", "E226", "E24", "E704"] + + # Set the maximum length that any line (with some exceptions) may be. + # Exceptions include lines that are either strings or comments which are + # entirely URLs. For example: + # ``` + # # https://some-super-long-domain-name.com/with/some/very/long/path + # url=( + # 'http://...' + # ) + # This defaults to: 79 +max_line_length=80 + + # Report all errors, even if it is on the same line as a # NOQA comment. # NOQA + # can be used to silence messages on specific lines. Sometimes, users will want + # to see what errors are being silenced without editing the file. This option + # allows you to see all the warnings, errors, etc. reported. + # This default to : False +disable_noqa=true + + # Print the source code generating the error/warning in question. +show_source=true + + # Count the number of occurrences of each error/warning code and print a report. +statistics=true + + # Enable off-by-default extensions. + # Plugins to Flake8 have the option of registering themselves as off-by-default. + # These plugins effectively add themselves to the default ignore list. +#enable-extensions = +# H111, +# G123 + + # Specify the number of subprocesses that Flake8 will use to run checks in parallel. + # Note + # This option is ignored on Windows because multiprocessing does not support + # Windows across all supported versions of Python. + # This defaults to: auto + # The default behaviour will use the number of CPUs on your machine as reported + # by multiprocessing.cpu_count(). +jobs="auto" + + # Redirect all output to the specified file. +output-file=".direnv/log/flakehell.log" + + # Also print output to stdout if output-file has been configured. +tee=true + + # Provide a custom list of builtin functions, objects, names, etc. + # This allows you to let pyflakes know about builtins that it may not + # immediately recognize so it does not report warnings for using an undefined + # name. + # This is registered by the default PyFlakes plugin. +#builtins = +# _, +# _LE, +# _LW + + # Enable PyFlakes syntax checking of doctests in docstrings. + # This is registered by the default PyFlakes plugin. +#doctests=True + + # Specify which files are checked by PyFlakes for doctest syntax. + # This is registered by the default PyFlakes plugin. +#include-in-doctest = +# dir/subdir/file.py, +# dir/other/file.py + + # Specify which files are not to be checked by PyFlakes for doctest syntax. + # This is registered by the default PyFlakes plugin. + # exclude-in-doctest = + # dir/subdir/file.py, + # dir/other/file.py + +[tool.flakehell.plugins] + # Python code style checker + # https://pypi.org/project/pycodestyle/ +pycodestyle=["-W503"] + + # Passive checker of Python programs + # https://pypi.org/project/pyflakes/ +pyflakes=["+*"] + +### END MKDOCS TEMPLATE ### + + +# ***************************************************************************** +# VIM MODELINE +# vim: ft=toml:fdm=indent:fdi= +# *****************************************************************************