-
Notifications
You must be signed in to change notification settings - Fork 732
clean code #2164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
clean code #2164
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f2a8d79
clean code
joamatab 6af8b4c
format code with black
joamatab 6b47646
run black and add pre-commit
joamatab 0960da9
delete some workflows
joamatab 6470d14
remove shellcheck
joamatab 314d390
remove nbstrip
joamatab f1c83bf
make sure sourcery min python version is 3.7
joamatab 7e69a3a
include clang formatter in pre-commit
joamatab 00bc81a
fix import
joamatab 2cfd060
run ci/cd every day
joamatab 48194cf
revert reorder imports from the adjoint module
joamatab 83dc114
remove isort from pre-commit
joamatab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,11 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "pip" | ||
| directory: "/" # Location of package manifests | ||
| schedule: | ||
| interval: "daily" | ||
|
|
||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: monthly |
This file contains hidden or 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 hidden or 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,16 @@ | ||
| --- | ||
| name: pre-commit | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
|
|
||
| jobs: | ||
| pre-commit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: 3.9 | ||
| - uses: pre-commit/[email protected] |
This file contains hidden or 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 hidden or 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,112 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: "08b4be84be2d74173246b7c9b6c22212a6c15a2d" | ||
| hooks: | ||
| - id: check-yaml | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
|
|
||
| # - repo: https://github.com/hakancelik96/unimport | ||
| # rev: df8eb1a4c91acb84da197828af8157708968b596 | ||
| # hooks: | ||
| # - id: unimport | ||
| # args: [--remove, --include-star-import] | ||
| # - repo: https://github.com/pycqa/isort | ||
| # rev: "12cc5fbd67eebf92eb2213b03c07b138ae1fb448" | ||
| # hooks: | ||
| # - id: isort | ||
| # files: "python/.*" | ||
| # args: ["--profile", "black", "--filter-files"] | ||
|
|
||
| - repo: https://github.com/psf/black | ||
| rev: "4f1772e2aed8356e57b923eacf45f813ec3324a0" | ||
| hooks: | ||
| - id: black | ||
|
|
||
| # - repo: https://gitlab.com/pycqa/flake8 | ||
| # rev: "21d3c70d676007470908d39b73f0521d39b3b997" | ||
| # hooks: | ||
| # - id: flake8 | ||
|
|
||
| # - repo: https://github.com/kynan/nbstripout | ||
| # rev: 8cafdcc393232045208137698dbeb42d6e0dd9e8 | ||
| # hooks: | ||
| # - id: nbstripout | ||
| # files: ".ipynb" | ||
|
|
||
| - repo: https://github.com/asottile/pyupgrade | ||
| rev: v2.37.3 | ||
| hooks: | ||
| - id: pyupgrade | ||
| args: [--py37-plus, --keep-runtime-typing] | ||
|
|
||
| # - repo: https://github.com/codespell-project/codespell | ||
| # rev: 4d782511b3999c243feb3858cd7062270eb13291 | ||
| # hooks: | ||
| # - id: codespell | ||
| # args: ["-L TE,TE/TM,te,ba,FPR,fpr_spacing,ro"] | ||
|
|
||
| # - repo: https://github.com/shellcheck-py/shellcheck-py | ||
| # rev: f87a493c6596a5338d69395905a4e13ed65584f6 | ||
| # hooks: | ||
| # - id: shellcheck | ||
|
|
||
| - repo: https://github.com/pre-commit/pygrep-hooks | ||
| rev: dc89c436469616a7c48293ec60c8e21e9d95be08 # Use the ref you want to point at | ||
| hooks: | ||
| - id: python-use-type-annotations | ||
|
|
||
| - repo: https://github.com/PyCQA/bandit | ||
| rev: 97501817e621db9975dfa6a2a1d36370942d1812 | ||
| hooks: | ||
| - id: bandit | ||
| args: [--exit-zero] | ||
| # ignore all tests, not just tests data | ||
| exclude: ^tests/ | ||
| - repo: https://github.com/pre-commit/mirrors-clang-format | ||
| rev: 'v14.0.6' # Use the sha / tag you want to point at | ||
| hooks: | ||
| - id: clang-format | ||
| # - repo: https://github.com/pre-commit/mirrors-mypy | ||
| # rev: "214c33306afe17f1cc7d2d55e4da705b6ebe0627" | ||
| # hooks: | ||
| # - id: mypy | ||
| # exclude: ^(docs/|example-plugin/|tests/fixtures) | ||
| # additional_dependencies: | ||
| # - "pydantic" | ||
| # - repo: https://github.com/terrencepreilly/darglint | ||
| # rev: master | ||
| # hooks: | ||
| # - id: darglint | ||
|
|
||
| # - repo: https://github.com/pycqa/pydocstyle | ||
| # rev: "" | ||
| # hooks: | ||
| # - id: pydocstyle | ||
| # - repo: https://github.com/asottile/reorder_python_imports | ||
| # rev: 2b2f0c74acdb3de316e23ceb7dd0d7945c354050 | ||
| # hooks: | ||
| # - id: reorder-python-imports | ||
| # - repo: https://github.com/PyCQA/pylint | ||
| # rev: v2.14.1 | ||
| # hooks: | ||
| # - id: pylint | ||
| # args: [--exit-zero] | ||
| # - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
| # rev: 6565d773ca281682d7062d4c0be74538cc474cc9 | ||
| # hooks: | ||
| # - id: pretty-format-java | ||
| # args: [--autofix] | ||
| # - id: pretty-format-kotlin | ||
| # args: [--autofix] | ||
| # - id: pretty-format-yaml | ||
| # args: [--autofix, --indent, "2"] | ||
| # - repo: https://github.com/adrienverge/yamllint.git | ||
| # rev: v1.21.0 # or higher tag | ||
| # hooks: | ||
| # - id: yamllint | ||
| # args: [--format, parsable, --strict] | ||
| # - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
| # rev: 0.1.0 # or specific tag | ||
| # hooks: | ||
| # - id: yamlfmt | ||
This file contains hidden or 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,2 @@ | ||
| refactor: | ||
| python_version: '3.7' |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -17,4 +17,4 @@ Ian Williamson <[email protected]> | |
| Andreas Hoenselaar <[email protected]> | ||
| Ben Bartlett <[email protected]> | ||
| Krishna Gadepalli <[email protected]> | ||
| Mo Chen <[email protected]> | ||
| Mo Chen <[email protected]> | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -12,4 +12,3 @@ class {class_name}({base_classes}): | |
| {docstring} | ||
|
|
||
| </div> | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -9,4 +9,4 @@ def {function_name}{parameters}:{other_signatures} | |
|
|
||
| {docstring} | ||
|
|
||
| </div> | ||
| </div> | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -13,4 +13,4 @@ def {method_name}{parameters}:{other_signatures} | |
|
|
||
| </div> | ||
|
|
||
| </div> | ||
| </div> | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.