Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
1f716b9
fix(typehint): add failing regression test to demonstrate existing be…
adamgranthendry Jun 28, 2022
3166587
fix(typehint): use redundant alias imports to fix mypy errors
adamgranthendry Jun 28, 2022
978764e
Merge branch 'main' into fix/typehint
tkoyama010 Jun 28, 2022
ac7911a
fix(mypy): add `mypy` to `environment.yml` dependencies
adamgranthendry Jun 28, 2022
e91226f
fix(formatting): add pre-commit and fix formatting to better align wi…
adamgranthendry Jun 28, 2022
a10703e
Merge branch 'main' into fix/typehint
tkoyama010 Jun 28, 2022
d0a42ce
fix(requirements): remove `check-json-schema` as this is imported dir…
adamgranthendry Jun 28, 2022
e6f1b45
refactor(pylintrc): remove commented-out disable options from `.pylin…
adamgranthendry Jun 28, 2022
3441552
fix(dependencies): correct python and pip requirements
adamgranthendry Jun 28, 2022
6f5fb98
fix(classifiers): correct trove classifiers
adamgranthendry Jun 28, 2022
bb5da9a
fix(pylint): correct pylint errors and add to pre-commit
adamgranthendry Jun 28, 2022
5dce1b0
refactor(line-length): change max line length to 100
adamgranthendry Jun 28, 2022
92015f4
feat(test): add test for baseplotter noop and revert to 72 character …
adamgranthendry Jun 28, 2022
55ad30d
refactor(line-lengths): revert to 100-character line lengths
adamgranthendry Jun 28, 2022
2a82336
fix(baseplotter-noop): revert to using empty lambda for noop
adamgranthendry Jun 28, 2022
7ec218c
fix(baseplotter_noop): revert to one-arg noop lambda for base plotter
adamgranthendry Jun 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
skip = *.pyc,*.txt,*.gif,*.png,*.jpg,*.ply,*.vtk,*.vti,*.vtu,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,doc/_build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/examples/*,*.mypy_cache/*,*cover,./tests/tinypages/_build/*,*/_autosummary/*
ignore-words-list = lod,byteorder,flem,parm,doubleclick,revered,PullRequest
quiet-level = 3
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source = pyvistaqt
omit =
*/setup.py
*/pyvistaqt/rwi.py
*/py.typed

[report]
exclude_lines =
Expand Down
36 changes: 36 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[flake8]
max-line-length = 100
exclude =
__pycache__,
.venv,
.cache,
.eggs
.git,
.tox,
*.egg-info,
*.pyc,
*.pyi,
build,
dist,
# This is adopted from VTK
pyvistaqt/rwi.py,
max-complexity = 10
doctests = true
extend-ignore =
# whitespace before ':'
E203,
# line break before binary operator
W503,
# line length too long
E501,
# do not assign a lambda expression, use a def
E731,
# missing class docstring; use ``__init__`` docstring instead
D101,
# missing docstring in magic method
D105,
# Qt uses camelCase
N802
per-file-ignores =
# "Imported but unused: happens with packages
__init__.py:F401
6 changes: 0 additions & 6 deletions .isort.cfg

This file was deleted.

64 changes: 64 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://gitlab.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [
"flake8-black==0.3.2",
"flake8-isort==4.1.1",
"flake8-quotes==3.3.1",
]

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args: [
"doc examples examples_flask pyvista tests",
"*.py *.rst *.md",
]

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
additional_dependencies: [toml==0.10.2]
files: ^(pyvista/|other/)
exclude: ^pyvista/ext/

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: no-commit-to-branch
args: [--branch, main]

# this validates our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.16.2
hooks:
- id: check-github-workflows

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
]
99 changes: 20 additions & 79 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
# 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=vtk
extension-pkg-whitelist=vtk,
PyQt5,
PyQt6,
PySide2,
PySide6

# 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=CVS
ignore=rwi.py,
conf.py,
conftest.py

# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=
ignore-patterns=test_.*[.]py

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
Expand Down Expand Up @@ -60,89 +66,21 @@ confidence=
# --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=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
bad-continuation,
arguments-differ,
no-name-in-module,
no-member
no-member,
# Redundant alias imports required for type hinting by PEP 484
useless-import-alias,
# Qt uses PascalCase
invalid-name,

# 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
Expand Down Expand Up @@ -446,8 +384,11 @@ max-module-lines=1000
# 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
#
# Removed in version 2.15
# https://pylint.pycqa.org/en/latest/whatsnew/2/2.6/summary.html#summary-release-highlights
; 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.
Expand Down
Loading