mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 00:14:41 +01:00

* refactor: remove usage of global variables in abbrevs.py * chore: add flake8-mutable to prevent mutable defaults * fix: abbrevs expand test * refactor: add xonsh session singleton * refactor: fix circular errors when using xonshSession as singleton * refactor: remove black magicked builtin attributes * style: black format tests as well * refactor: update tests to use xonsh-session singleton * refactor: update abbrevs to not use builtins * test: remove DummyCommandsCache and patch orig class * fix: failing test_command_completers * test: use monkeypatch to update xession fixture * fix: failing test_pipelines * fix: failing test_main * chore: run test suit as single invocation * test: fix tests/test_xonsh.xsh * refactor: remove builtins from docs/conf.py * fix: mypy error in jobs * fix: test error from test_main * test: close xession error in test_command_completers * chore: use pytest-cov for reporting coverage this will include subprocess calls, and will increase coverage * style:
115 lines
4.1 KiB
INI
115 lines
4.1 KiB
INI
# Use of pytest --flake8 is deprecated in favor of flake8 direct.
|
|
# Thus the developer's IDE can use the same lint config as CI.
|
|
# pytest-flake8 --ignore is an incompatible superset of flake8 --ignore, --per-file-ignores and --exclude
|
|
# and we don't want to maintain the same list in 2 formats.
|
|
[flake8]
|
|
max-line-length = 180
|
|
exclude =
|
|
__amalgam__.py,
|
|
tests/,
|
|
docs/,
|
|
*/ply/,
|
|
parser*_table.py,
|
|
completion_parser_table.py,
|
|
build/,
|
|
dist/,
|
|
setup.py,
|
|
.vscode/,
|
|
feedstock,
|
|
rever,
|
|
.venv*/,
|
|
.local.out*/
|
|
# lint nits that are acceptable in Xonsh project:
|
|
ignore =
|
|
D100, # Missing docstring in public module
|
|
D101, # Missing docstring in public class
|
|
D102, # Missing docstring in public method
|
|
D103, # Missing docstring in public function
|
|
D104, # Missing docstring in public package
|
|
D105, # Missing docstring in magic method
|
|
D200, # One-line docstring should fit on one line with quotes
|
|
D202, # No blank lines allowed after function docstring
|
|
D205, # 1 blank line required between summary line and description
|
|
D207, # Docstring is under-indented
|
|
D208, # Docstring is over-indented
|
|
D209, # Multi-line docstring closing quotes should be on a separate line
|
|
D210, # No whitespaces allowed surrounding docstring text
|
|
D301, # Use r""" if any backslashes in a docstring
|
|
D400, # First line should end with a period
|
|
D401, # First line should be in imperative mood
|
|
D403, # First word of the first line should be properly capitalized
|
|
D404, # First word of the docstring should not be `This`
|
|
D406, # Section name should end with a newline
|
|
D409, # Section underline should match the length of its name
|
|
D411, # Missing blank line before section
|
|
D407, # Missing dashed underline after section
|
|
E122, # continuation line missing indentation or outdented
|
|
E203, # whitespace before ':'
|
|
E402, # module level import not at top of file
|
|
W503, # line break before binary operators is a good thing
|
|
E731, # accept lambda assigned to a variable
|
|
|
|
per-file-ignores =
|
|
# flake8 gives incorrect unused import errors, F401
|
|
tests/tools.py:E128,
|
|
xonsh/ast.py:F401,
|
|
xonsh/built_ins.py:F821 E721,
|
|
xonsh/built_ins.py:E721,
|
|
xonsh/commands_cache.py:F841,
|
|
xonsh/history.py:F821,
|
|
xonsh/jupyter_kernel.py:E203,
|
|
xonsh/platform.py:F401 E305,
|
|
xonsh/proc.py:E261 E265,
|
|
xonsh/ptk/key_bindings.py:F841,
|
|
xonsh/ptk/shell.py:E731,
|
|
xonsh/pyghooks.py:F821,
|
|
xonsh/readline_shell.py:F401,
|
|
xonsh/style_tools.py:F821 E305,
|
|
xonsh/timings.py:F401,
|
|
xonsh/tokenize.py:F821 F841,
|
|
xonsh/tools.py:E731 E305,
|
|
xonsh/xonfig.py:E731,
|
|
xontrib/vox.py:F821,
|
|
# remove these later
|
|
xonsh/color_tools.py:E305
|
|
xonsh/completers/_aliases.py:E305,
|
|
xonsh/completers/python.py:E722,
|
|
xonsh/inspectors.py:E722
|
|
xonsh/lexer.py:E741,
|
|
xonsh/parsers/context_check.py:E305,
|
|
xonsh/parsers/base.py:E741,
|
|
xonsh/style_tools.py:E305,
|
|
xonsh/tools.py:E305,
|
|
xonsh/winutils.py:E305,
|
|
xonsh/xoreutils/*.py:E722 E305,
|
|
|
|
# pydocstyle plugin
|
|
docstring-convention=numpy
|
|
|
|
[mypy]
|
|
# --- https://mypy.readthedocs.io/en/stable/config_file.html
|
|
# try to keep all under .cache directory
|
|
cache_dir = .cache/mypy/
|
|
# warn_unused_ignores = True
|
|
warn_unused_configs = True
|
|
warn_no_return = False
|
|
; a regex to exclude certain directories
|
|
exclude = xonsh/ply
|
|
|
|
# report
|
|
show_error_context = True
|
|
show_column_numbers = True
|
|
show_error_codes = True
|
|
pretty = True
|
|
|
|
# the __init__ files have dynamic check - ignoring the attribute error. others are generated files
|
|
# top level package name only ignores the __init__.py file.
|
|
[mypy-xonsh.parser_table,xonsh.completion_parser_table,xonsh.parsers.parser_table.*,xonsh.parsers.completion_parser_table.*,*.__amalgam__.*,xonsh,xonsh.prompt,xonsh.history,xonsh.completers,xonsh.procs]
|
|
ignore_errors = True
|
|
|
|
# 3rd party libraries that we dont have control over
|
|
[mypy-zmq.*,setproctitle,xonsh.ply.*,jupyter_client.*,winreg.*,pygments.*,prompt_toolkit.*,importlib_resources.*,nt.*,prompt_toolkit.*,distro.*,conda_suggest.*,_winreg.*,*.__amalgam__.*]
|
|
ignore_missing_imports = True
|
|
|
|
[tool:pytest]
|
|
cache_dir = .cache/pytest
|