forked from HumanCompatibleAI/imitation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pre-commit and infinite length horizons documentation (HumanCompatibl…
…eAI#603) * add pre-commit-config.yaml and document nonsupport for infinite horizons * add circleci config check to precommit * Reorganize config file and add missing flake8 dependencies * Add notebooks check * Add pre-commit to test requirements * Auto-fix trailing whitespace or end of files * Fix flake8 errors * Fix typo in exclude types * Make pytype and mypy run locally with dependencies; add docs build * Speed up doc build in precommit by skipping tests and building notebooks * Merge darglint into flake8 (gives us parallelism and better handling of noqa) * Remove code checks script * Try pinning pyglet * Move check-ast first * Fix import os bug in doctest Co-authored-by: Adam Gleave <[email protected]>
- Loading branch information
1 parent
e143489
commit f64f5f8
Showing
26 changed files
with
156 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ exclude_lines = | |
pragma: no cover | ||
@overload | ||
@typing.overload | ||
raise NotImplementedError | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,4 +159,4 @@ dmypy.json | |
# Produced by examples/quickstart.sh | ||
/quickstart/ | ||
|
||
.vscode/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
# Linting | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: check-ast | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
exclude_types: [jupyter] | ||
- id: check-toml | ||
- id: check-added-large-files | ||
- repo: https://github.com/psf/black | ||
rev: 22.6.0 | ||
hooks: | ||
- id: black | ||
- id: black-jupyter | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
# Python static analysis | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: '5.0.4' | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- darglint~=1.8.1 | ||
- flake8-blind-except==0.2.1 | ||
- flake8-builtins~=1.5.3 | ||
- flake8-commas~=2.1.0 | ||
- flake8-debugger~=4.1.2 | ||
- flake8-docstrings~=1.6.0 | ||
# Shell static analysis | ||
- repo: https://github.com/koalaman/shellcheck-precommit | ||
rev: v0.8.0 | ||
hooks: | ||
- id: shellcheck | ||
# Misc | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.2 | ||
hooks: | ||
- id: codespell | ||
args: ["--skip=*.pyc,tests/testdata/*,*.ipynb,*.csv"] | ||
- repo: https://github.com/syntaqx/git-hooks | ||
rev: v0.0.17 | ||
hooks: | ||
- id: circleci-config-validate | ||
# Hooks that run in local environment (not isolated venv) as they need | ||
# same dependencies as our package. | ||
- repo: local | ||
hooks: | ||
- id: check-notebooks | ||
name: check-notebooks | ||
entry: ./ci/clean_notebooks.py --check ./docs/tutorials/ | ||
language: script | ||
types: [jupyter] | ||
pass_filenames: false | ||
# Run mypy directly from local repo rather than using mirror-mypy | ||
# so that it uses installed dependencies. Adapted from: | ||
# https://jaredkhan.com/blog/mypy-pre-commit | ||
- id: mypy | ||
name: mypy | ||
language: system | ||
types: [python] | ||
entry: mypy --follow-imports=silent --show-error-codes | ||
# use require_serial so that script | ||
# is only called once per commit | ||
require_serial: true | ||
# Print the number of files as a sanity-check | ||
verbose: true | ||
- id: pytype | ||
name: pytype | ||
language: system | ||
types: [python] | ||
entry: pytype -j auto | ||
require_serial: true | ||
verbose: true | ||
- id: docs | ||
name: docs | ||
language: system | ||
types_or: [python, rst] | ||
entry: bash -c "cd docs/ && make clean && SKIP_DOCTEST=True NB_EXECUTION_MODE=off make html" | ||
require_serial: true | ||
verbose: true | ||
pass_filenames: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
_api | ||
_api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.sidebar-container, .toc-drawer{ | ||
box-sizing:border-box; | ||
width:20em; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.