Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ jobs:
run: black .
- name: flake8
run: flake8 .
- name: mypy
run: mypy .
- name: bandit
run: bandit .
- name: safety
run: safety check
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* Add `sort_dict` option (thanks @gergelyk).
* Use `pytest` instead of `nose` (thanks @pgajdos).
* Use GitHub Actions instead of Travis.
* Linting: `isort`, `black`, `flake8`.
* Linting: `isort`, `black`, `flake8` and `mypy`.
Wrapping at 100 lines from the previous 80.
* Security: `safety` and `bandit`.
* Other file and folder restructuring.

0.4.0
Expand Down
4 changes: 2 additions & 2 deletions pprintpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,13 @@ def _recursion(self, object, state):
import numpy as np
except ImportError:

class np(object):
class np(object): # type: ignore
@staticmethod
def array(o):
return o

somelist = [1, 2, 3]
recursive = []
recursive = [] # type: ignore # TODO: Add type hinting for mypy
recursive.extend([recursive, recursive, recursive])
pprint(
{
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[tool.bandit]
recursive = true # TODO: fix

[tool.black]
line-length = 100
Expand All @@ -17,7 +18,8 @@ testpaths = ['tests']
python_version = '3.7'
warn_return_any = true
warn_unused_configs = true
exclude = ['pp/setup.py']

[[tool.mypy.overrides]]
module = ['invoke', 'pytest_check']
module = ['IPython', 'numpy', 'traitlets.*']
ignore_missing_imports = true
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-r requirements-test.txt
bandit # Always want latest
black==22.3.0
flake8==4.0.1
isort==5.10.1
mypy==0.942
safety # Always want latest
types-setuptools == 57.4.12