diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..4c5b0006 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,70 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + # - id: check-added-large-files + - id: check-case-conflict + - id: check-json + - id: check-merge-conflict + - id: check-yaml + - id: end-of-file-fixer + exclude: "__snapshots__/" + - id: fix-encoding-pragma + args: [--remove] + - id: mixed-line-ending + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + exclude: "__snapshots__/" + - id: pretty-format-json + args: [--autofix] + exclude: "__snapshots__/" + # this is not technically always safe but usually is + # use comments `# isort: off` and `# isort: on` to disable/re-enable isort + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + args: [--line-length=240, --profile=black] + + # this is slightly dangerous because python imports have side effects + # and this tool removes unused imports, which may be providing + # necessary side effects for the code to run + - repo: https://github.com/PyCQA/autoflake + rev: v1.6.1 + hooks: + - id: autoflake + args: + - "--in-place" + - "--expand-star-imports" + - "--remove-duplicate-keys" + - "--remove-unused-variables" + - "--remove-all-unused-imports" + + - repo: https://github.com/psf/black + rev: 22.8.0 + hooks: + - id: black + args: [--line-length=120, --exclude=""] + + - repo: local + hooks: + - id: mypy + name: mypy + entry: mypy + language: system + types: [python] + exclude: migrations/|commands/|scripts/|sandbox/|samples|sdk|examples + args: + [ + --pretty, + --show-error-codes, + --implicit-optional, + --follow-imports=silent, + --warn-redundant-casts, + --warn-unused-ignores, + --disallow-any-generics, + --check-untyped-defs, + --no-implicit-reexport, + --disallow-untyped-defs, + --install-types, + ] diff --git a/doc/html/_static/basic.css b/doc/html/_static/basic.css index c41d718e..af807072 100644 --- a/doc/html/_static/basic.css +++ b/doc/html/_static/basic.css @@ -760,4 +760,4 @@ div.math:hover a.headerlink { #top-link { display: none; } -} \ No newline at end of file +} diff --git a/doc/html/_static/documentation_options.js b/doc/html/_static/documentation_options.js index 6d865102..58357acc 100644 --- a/doc/html/_static/documentation_options.js +++ b/doc/html/_static/documentation_options.js @@ -7,4 +7,4 @@ var DOCUMENTATION_OPTIONS = { HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', NAVIGATION_WITH_KEYS: false -}; \ No newline at end of file +}; diff --git a/doc/html/_static/language_data.js b/doc/html/_static/language_data.js index 5266fb19..f891ac19 100644 --- a/doc/html/_static/language_data.js +++ b/doc/html/_static/language_data.js @@ -13,7 +13,7 @@ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; -/* Non-minified version JS is _stemmer.js if file is provided */ +/* Non-minified version JS is _stemmer.js if file is provided */ /** * Porter Stemmer */ @@ -293,5 +293,3 @@ function splitQuery(query) { } return result; } - - diff --git a/doc/html/_static/nature.css b/doc/html/_static/nature.css index 5fb55b12..43a6b92b 100644 --- a/doc/html/_static/nature.css +++ b/doc/html/_static/nature.css @@ -8,11 +8,11 @@ * :license: BSD, see LICENSE for details. * */ - + @import url("basic.css"); - + /* -- page layout ----------------------------------------------------------- */ - + body { font-family: Arial, sans-serif; font-size: 100%; @@ -34,18 +34,18 @@ div.bodywrapper { hr { border: 1px solid #B1B4B6; } - + div.document { background-color: #eee; } - + div.body { background-color: #ffffff; color: #3E4349; padding: 0 30px 30px 30px; font-size: 0.9em; } - + div.footer { color: #555; width: 100%; @@ -53,12 +53,12 @@ div.footer { text-align: center; font-size: 75%; } - + div.footer a { color: #444; text-decoration: underline; } - + div.related { background-color: #6BA81E; line-height: 32px; @@ -66,11 +66,11 @@ div.related { text-shadow: 0px 1px 0 #444; font-size: 0.9em; } - + div.related a { color: #E2F3CC; } - + div.sphinxsidebar { font-size: 0.75em; line-height: 1.5em; @@ -79,7 +79,7 @@ div.sphinxsidebar { div.sphinxsidebarwrapper{ padding: 20px 0; } - + div.sphinxsidebar h3, div.sphinxsidebar h4 { font-family: Arial, sans-serif; @@ -95,30 +95,30 @@ div.sphinxsidebar h4 { div.sphinxsidebar h4{ font-size: 1.1em; } - + div.sphinxsidebar h3 a { color: #444; } - - + + div.sphinxsidebar p { color: #888; padding: 5px 20px; } - + div.sphinxsidebar p.topless { } - + div.sphinxsidebar ul { margin: 10px 20px; padding: 0; color: #000; } - + div.sphinxsidebar a { color: #444; } - + div.sphinxsidebar input { border: 1px solid #ccc; font-family: sans-serif; @@ -131,17 +131,17 @@ div.sphinxsidebar .searchformwrapper { } /* -- body styles ----------------------------------------------------------- */ - + a { color: #005B81; text-decoration: none; } - + a:hover { color: #E32E00; text-decoration: underline; } - + div.body h1, div.body h2, div.body h3, @@ -156,30 +156,30 @@ div.body h6 { padding: 5px 0 5px 10px; text-shadow: 0px 1px 0 white } - + div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; } div.body h2 { font-size: 150%; background-color: #C8D5E3; } div.body h3 { font-size: 120%; background-color: #D8DEE3; } div.body h4 { font-size: 110%; background-color: #D8DEE3; } div.body h5 { font-size: 100%; background-color: #D8DEE3; } div.body h6 { font-size: 100%; background-color: #D8DEE3; } - + a.headerlink { color: #c60f0f; font-size: 0.8em; padding: 0 4px 0 4px; text-decoration: none; } - + a.headerlink:hover { background-color: #c60f0f; color: white; } - + div.body p, div.body dd, div.body li { line-height: 1.5em; } - + div.admonition p.admonition-title + p { display: inline; } @@ -192,29 +192,29 @@ div.note { background-color: #eee; border: 1px solid #ccc; } - + div.seealso { background-color: #ffc; border: 1px solid #ff6; } - + div.topic { background-color: #eee; } - + div.warning { background-color: #ffe4e4; border: 1px solid #f66; } - + p.admonition-title { display: inline; } - + p.admonition-title:after { content: ":"; } - + pre { padding: 10px; background-color: White; @@ -226,7 +226,7 @@ pre { -webkit-box-shadow: 1px 1px 1px #d8d8d8; -moz-box-shadow: 1px 1px 1px #d8d8d8; } - + code { background-color: #ecf0f3; color: #222; @@ -249,4 +249,4 @@ div.code-block-caption { background-color: #ddd; color: #222; border: 1px solid #C6C9CB; -} \ No newline at end of file +} diff --git a/doc/html/_static/pygments.css b/doc/html/_static/pygments.css index 20c4814d..9b7363c7 100644 --- a/doc/html/_static/pygments.css +++ b/doc/html/_static/pygments.css @@ -66,4 +66,4 @@ .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ -.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ diff --git a/doc/html/genindex.html b/doc/html/genindex.html index b24ee611..82d844aa 100644 --- a/doc/html/genindex.html +++ b/doc/html/genindex.html @@ -14,7 +14,7 @@ - +
+