Skip to content

Commit 9f13b65

Browse files
authored
Merge pull request #46 from MC-kit/devel
Devel
2 parents 1647934 + c8bb17e commit 9f13b65

38 files changed

+666
-440
lines changed

.flake8

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
[flake8]
22
# select=ANN,B,B9,BLK,C,D,DAR,E,F,I,S,W
3-
select=ANN,B,B9,BLK,C,D,DAR,E,F,S,W
3+
select=ANN,B,B9,BLK,C,D,DAR,E,F,TC,S,W
44
max-complexity=10
55
max-line-length=88
66
ignore=
77
# ANN101 Missing type annotation for self in method
88
ANN101
99
# ANN102 Missing type annotation for cls in classmethod
1010
ANN102
11+
# Missing docstring in __init__
12+
D107
1113
# E203: Whitespace before ‘:'
12-
E203,
14+
E203
1315
# E501: Line too long
14-
E501,
16+
E501
1517
# W503: Line break before binary operator: for compatibility with black settings
1618
W503
1719
exclude=
18-
.git,
19-
__pycache__,
20-
src/mapstp/cli/runner.py,
21-
docs/source/conf.py,
22-
adhoc,
23-
wrk,
24-
build,
25-
dist,
20+
.git
21+
noxfile.py
22+
__pycache__
23+
src/mapstp/cli/runner.py
24+
docs/source/conf.py
25+
adhoc
26+
wrk
27+
build
28+
dist
29+
tools
2630
per-file-ignores =
2731
noxfile.py:ANN,DAR101
32+
config.py:ANN001,ANN201
2833
tests/*:S101,ANN,DAR100,D100,D103,DAR101,DAR103
2934
ignore-decorators=click,pytest
3035
docstring-convention = google

.github/dependabot.yml

+29-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
version: 2
2+
23
updates:
3-
- package-ecosystem: pip
4-
directory: "/"
5-
schedule:
6-
interval: monthly
7-
time: "11:00"
8-
open-pull-requests-limit: 10
9-
target-branch: devel
4+
5+
- package-ecosystem: pip
6+
directory: "/"
7+
schedule:
8+
interval: monthly
9+
day: monday
10+
time: "11:00"
11+
open-pull-requests-limit: 10
12+
target-branch: devel
13+
14+
- package-ecosystem: "github-actions"
15+
# Workflow files stored in the default location of `.github/workflows`
16+
directory: "/"
17+
schedule:
18+
interval: monthly
19+
day: tuesday
20+
time: "11:00"
21+
open-pull-requests-limit: 10
22+
target-branch: devel
23+
24+
- package-ecosystem: "gitsubmodule"
25+
directory: "/"
26+
schedule:
27+
interval: monthly
28+
day: wednesday
29+
time: "11:00"
30+
open-pull-requests-limit: 10
31+
target-branch: devel

.pre-commit-config.yaml

+155-21
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,176 @@
1-
# See https://pre-commit.com for more information
2-
# See https://pre-commit.com/hooks.html for more hooks
1+
# To use:
2+
#
3+
# pre-commit run -a
4+
#
5+
# Or:
6+
#
7+
# pre-commit install # (runs every time you commit in git)
8+
#
9+
# To update this file:
10+
#
11+
# pre-commit autoupdate
12+
#
13+
# See https://github.com/pre-commit/pre-commit
314
repos:
15+
# Standard hooks
416
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.0.1
17+
rev: "v4.1.0"
618
hooks:
7-
- id: trailing-whitespace
8-
exclude: \.(xlsx|zip)$|data|\.idea
9-
- id: end-of-file-fixer
10-
exclude: \.(xlsx|zip)$|data|docs|\.idea
11-
- id: check-yaml
12-
- id: check-toml
13-
- id: check-added-large-files
19+
- id: check-added-large-files
20+
- id: check-case-conflict
21+
# - id: check-docstring-first
22+
- id: check-merge-conflict
23+
- id: check-symlinks
24+
- id: check-toml
25+
- id: check-yaml
26+
- id: debug-statements
27+
- id: end-of-file-fixer
28+
exclude: data|.ipynb$|^\.
29+
- id: mixed-line-ending
30+
- id: requirements-txt-fixer
31+
- id: trailing-whitespace
32+
exclude: data|.ipynb$
33+
# TODO dvp: return rstcheck, fix docs files for that
1434
- repo: https://github.com/myint/rstcheck
1535
rev: 3f92957
1636
hooks:
1737
- id: rstcheck
1838
- repo: local
1939
hooks:
40+
# Nicely sort includes
2041
- id: isort
2142
name: isort
22-
exclude: dev|\.idea
43+
exclude: dev|\.idea|\.cache
2344
entry: poetry run isort
2445
language: system
2546
types: [python]
47+
# Black, the code formatter, natively supports pre-commit
2648
- id: black
2749
name: black
2850
entry: poetry run black
2951
language: system
3052
types: [python]
31-
- id: flake8
32-
name: flake8
33-
exclude: tests|runner|dev|\.idea
34-
entry: poetry run flake8
35-
language: system
36-
types: [python]
37-
# - id: mypy
38-
# name: mypy
39-
# exclude: tests|runner|dev
40-
# entry: poetry run mypy
53+
# - id: flake8
54+
# name: flake8
55+
# entry: poetry run flake8
4156
# language: system
4257
# types: [python]
58+
# Also code format the docs
59+
# - id: blacken-docs
60+
# name: blacken-docs
61+
# entry: poetry run blacken-docs
62+
# language: system
63+
64+
# Changes tabs to spaces
65+
- repo: https://github.com/Lucas-C/pre-commit-hooks
66+
rev: "v1.1.13"
67+
hooks:
68+
- id: remove-tabs
69+
70+
#- repo: https://github.com/sirosen/texthooks
71+
# rev: "0.3.1"
72+
# hooks:
73+
# - id: fix-ligatures
74+
# - id: fix-smartquotes
75+
76+
# Autoremoves unused imports
77+
- repo: https://github.com/hadialqattan/pycln
78+
rev: "v1.2.5"
79+
hooks:
80+
- id: pycln
81+
additional_dependencies: [click<8.1] # TODO Unpin when typer updates
82+
stages: [manual]
83+
84+
# Checking for common mistakes
85+
#- repo: https://github.com/pre-commit/pygrep-hooks
86+
# rev: "v1.9.0"
87+
# hooks:
88+
# - id: python-check-blanket-noqa
89+
# - id: python-check-blanket-type-ignore
90+
# - id: python-no-log-warn
91+
# - id: python-use-type-annotations
92+
# - id: rst-backticks
93+
# - id: rst-directive-colons
94+
# - id: rst-inline-touching-normal
95+
96+
# Automatically remove noqa that are not used
97+
- repo: https://github.com/asottile/yesqa
98+
rev: "v1.3.0"
99+
hooks:
100+
- id: yesqa
101+
additional_dependencies: &flake8_dependencies
102+
- flake8-bugbear
103+
- pep8-naming
104+
105+
# Flake8 also supports pre-commit natively (same author)
106+
#- repo: https://github.com/PyCQA/flake8
107+
# rev: "4.0.1"
108+
# hooks:
109+
# - id: flake8
110+
# exclude: ^(docs/.*|tools/.*)$
111+
# additional_dependencies: *flake8_dependencies
112+
113+
# PyLint has native support - not always usable, but works for us
114+
#- repo: https://github.com/PyCQA/pylint
115+
# rev: "v2.13.4"
116+
# hooks:
117+
# - id: pylint
118+
# files: ^pybind11
119+
120+
# CMake formatting
121+
#- repo: https://github.com/cheshirekow/cmake-format-precommit
122+
# rev: "v0.6.13"
123+
# hooks:
124+
# - id: cmake-format
125+
# additional_dependencies: [pyyaml]
126+
# types: [file]
127+
# files: (\.cmake|CMakeLists.txt)(.in)?$
128+
129+
# Check static types with mypy
130+
#- repo: https://github.com/pre-commit/mirrors-mypy
131+
# rev: "v0.942"
132+
# hooks:
133+
# - id: mypy
134+
# args: [--show-error-codes]
135+
# exclude: ^(tests|docs)/
136+
# additional_dependencies: [nox, rich]
137+
138+
# Checks the manifest for missing files (native support)
139+
#- repo: https://github.com/mgedmin/check-manifest
140+
# rev: "0.48"
141+
# hooks:
142+
# - id: check-manifest
143+
# # This is a slow hook, so only run this if --hook-stage manual is passed
144+
# stages: [manual]
145+
# additional_dependencies: [cmake, ninja]
146+
147+
# Check for spelling
148+
#- repo: https://github.com/codespell-project/codespell
149+
# rev: "v2.1.0"
150+
# hooks:
151+
# - id: codespell
152+
# exclude: ".supp$"
153+
# args: ["-L", "nd,ot,thist"]
154+
155+
# Check for common shell mistakes
156+
- repo: https://github.com/shellcheck-py/shellcheck-py
157+
rev: "v0.8.0.4"
158+
hooks:
159+
- id: shellcheck
160+
stages: [manual]
161+
162+
# Disallow some common capitalization mistakes
163+
#- repo: local
164+
# hooks:
165+
# - id: disallow-caps
166+
# name: Disallow improper capitalization
167+
# language: pygrep
168+
# entry: PyBind|Numpy|Cmake|CCache|PyTest
169+
# exclude: ^\.pre-commit-config.yaml$
170+
171+
# Clang format the codebase automatically
172+
#- repo: https://github.com/pre-commit/mirrors-clang-format
173+
# rev: "v13.0.1"
174+
# hooks:
175+
# - id: clang-format
176+
# types_or: [c++, c, cuda]

README.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ Contributing
6868
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
6969
:target: https://github.com/pre-commit/pre-commit
7070
:alt: pre-commit
71-
72-
71+
.. image:: https://img.shields.io/badge/try%2Fexcept%20style-tryceratops%20%F0%9F%A6%96%E2%9C%A8-black
72+
:target: https://github.com/guilatrova/tryceratops
73+
:alt: try/except style: tryceratops
7374

7475
.. Substitutions
7576

docs/make.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pushd %~dp0
55
REM Command file for Sphinx documentation
66

77
if "%SPHINXBUILD%" == "" (
8-
set SPHINXBUILD=sphinx-build
8+
set SPHINXBUILD=sphinx-build
99
)
1010
set SOURCEDIR=source
1111
set BUILDDIR=build
@@ -14,15 +14,15 @@ if "%1" == "" goto help
1414

1515
%SPHINXBUILD% >NUL 2>NUL
1616
if errorlevel 9009 (
17-
echo.
18-
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19-
echo.installed, then set the SPHINXBUILD environment variable to point
20-
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21-
echo.may add the Sphinx directory to PATH.
22-
echo.
23-
echo.If you don't have Sphinx installed, grab it from
24-
echo.https://www.sphinx-doc.org/
25-
exit /b 1
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org/
25+
exit /b 1
2626
)
2727

2828
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ sphinx==4.2.0
22
sphinx-autobuild==2021.3.14
33
sphinx-autodoc-typehints==1.12.0
44
sphinx-autorun==1.1.1
5-
sphinx-click==3.0.2
5+
sphinx-click==4.1.0
66
sphinx-rtd-theme==1.0.0
77
sphinxcontrib-napoleon==0.7

docs/source/index.rst

-3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,3 @@ Indices and tables
3434
* :ref:`genindex`
3535
* :ref:`modindex`
3636
* :ref:`search`
37-
38-
39-

docs/source/reference.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ mapstp.utils
2525
------------
2626

2727
.. automodule:: mapstp.utils
28-
:members:
28+
:members:

0 commit comments

Comments
 (0)