-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set up config for precommit, black, flake8, codespell, isort and run
- Loading branch information
Showing
71 changed files
with
7,459 additions
and
11,459 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[flake8] | ||
exclude = | ||
.git, | ||
__pycache__, | ||
build, | ||
dist, | ||
--select = D,E,F,W | ||
docstring-convention = numpy | ||
max-line-length = 250 | ||
# For PEP8 error codes see | ||
# http://pep8.readthedocs.org/en/latest/intro.html#error-codes | ||
# D100-D104: missing docstring | ||
# D105: missing docstring in magic method | ||
# D107: missing docstring in __init__ | ||
# W504: line break after binary operator | ||
per-file-ignores = | ||
**/__init__.py: D104 | ||
ignore = | ||
BLK100, | ||
D105 | ||
D107, | ||
E402, | ||
E266, | ||
E721, | ||
E731, | ||
E713, | ||
E714, | ||
E741, | ||
F403, | ||
F405, | ||
E401, | ||
F401, | ||
F811, | ||
F841, | ||
F821, | ||
FS001 | ||
W503, | ||
W504, | ||
W605, | ||
# for compatibility with black | ||
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8 | ||
extend-ignore = E203 |
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,9 @@ | ||
--- | ||
# Documentation | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly |
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,15 @@ | ||
--- | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- uses: pre-commit/[email protected] |
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,53 @@ | ||
--- | ||
name: Update precommit hooks | ||
|
||
|
||
on: | ||
|
||
# Uses the cron schedule for github actions | ||
# | ||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events | ||
# | ||
# ┌───────────── minute (0 - 59) | ||
# │ ┌───────────── hour (0 - 23) | ||
# │ │ ┌───────────── day of the month (1 - 31) | ||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | ||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
# * * * * * | ||
schedule: | ||
- cron: 0 0 * * 1 # every monday | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update_precommit_hooks: | ||
|
||
# only run on upstream repo | ||
if: github.repository_owner == 'SIMEXP' | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
allow-prereleases: false | ||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
- name: Update pre-commit hooks | ||
run: pre-commit autoupdate | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
commit-message: pre-commit hooks auto-update | ||
base: main | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
delete-branch: true | ||
title: '[BOT] update pre-commit hooks' | ||
body: done via this [GitHub Action](https://github.com/${{ github.repository_owner }}/giga_connectome/blob/main/.github/workflows/update_precommit_hooks.yml) |
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/ikamensh/flynt/ | ||
rev: 1.0.1 | ||
hooks: | ||
- id: flynt | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
args: [--profile, black] | ||
|
||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.12.1 | ||
hooks: | ||
- id: black-jupyter | ||
args: [--config, pyproject.toml] | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.6 | ||
hooks: | ||
- id: codespell | ||
args: [--toml, pyproject.toml] | ||
additional_dependencies: [tomli] | ||
|
||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
rev: 0.2.3 | ||
hooks: | ||
- id: yamlfmt | ||
args: [--mapping, '4', --sequence, '4', --offset, '0'] | ||
|
||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
rev: v2.12.0 | ||
hooks: | ||
- id: pretty-format-toml | ||
args: [--autofix, --indent, '4'] | ||
|
||
- repo: https://github.com/pyCQA/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
args: [--config, .flake8, --verbose, pydfc, rest_dFC, task_dFC] | ||
additional_dependencies: [flake8-use-fstring] |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.