-
Notifications
You must be signed in to change notification settings - Fork 5
Add linters, formatters, pre-commit hooks and Github Actions #35
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
Open
tarcisioe
wants to merge
7
commits into
master
Choose a base branch
from
refactor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3cef798
Update dev dependencies.
tarcisioe 90122ad
Apply black and isort and add formatting pre-commit hook.
tarcisioe 22fcb01
Create a contributing section on Readme.
tarcisioe e322eb0
Apply flake8 and resolve warnings.
tarcisioe 8d10924
Cleanup typing and pylint warnings.
tarcisioe a02ef08
Add github actions.
tarcisioe d7f3c7b
Avoid using subscriptable dict and set to keep Python 3.7 support.
tarcisioe 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [flake8] | ||
| max-line-length = 100 | ||
| select = C,E,F,W,B,B950 | ||
| ignore = E203, E501, W503, E741, B008 | ||
| per-file-ignores = | ||
| **/__init__.py: F403,F405 |
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,68 @@ | ||
| # vim: set ft=yaml ts=2 sw=2: | ||
|
|
||
| name: Summon Tasks | ||
|
|
||
| on: [push] | ||
|
|
||
| jobs: | ||
| lint: | ||
| strategy: | ||
| matrix: | ||
| python: ['3.7', '3.10'] | ||
| os: [ubuntu-latest] | ||
|
|
||
| name: Static checks | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Set up Python ${{ matrix.python }} | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: ${{ matrix.python }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install poetry | ||
| poetry install | ||
|
|
||
| - name: Run static checks | ||
| run: poetry run summon static-checks | ||
|
|
||
|
|
||
| # test: | ||
| # strategy: | ||
| # matrix: | ||
| # python: ['3.10'] | ||
| # os: [ubuntu-latest, windows-latest] | ||
|
|
||
| # name: Python ${{ matrix.python }} on ${{ matrix.os }} | ||
|
|
||
| # runs-on: ${{ matrix.os }} | ||
|
|
||
| # steps: | ||
| # - uses: actions/checkout@v2 | ||
|
|
||
| # - name: Set up Python ${{ matrix.python }} | ||
| # uses: actions/setup-python@v1 | ||
| # with: | ||
| # python-version: ${{ matrix.python }} | ||
|
|
||
| # - name: Install dependencies | ||
| # run: | | ||
| # python -m pip install --upgrade pip | ||
| # pip install poetry | ||
| # poetry install | ||
|
|
||
| # - name: Run tests | ||
| # run: poetry run summon test --coverage | ||
|
|
||
| # - name: Generate coverage.xml | ||
| # run: poetry run coverage xml | ||
|
|
||
| # - uses: codecov/codecov-action@v1 | ||
| # with: | ||
| # fail_ci_if_error: false # Setting this to true is a headache. | ||
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,20 @@ | ||
| repos: | ||
| - hooks: | ||
| - {id: check-yaml} | ||
| - {id: end-of-file-fixer} | ||
| - {id: trailing-whitespace} | ||
| repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.2.0 | ||
| - hooks: | ||
| - entry: poetry run summon lint --no-full-report | ||
| id: linters | ||
| language: system | ||
| name: Lint | ||
| require_serial: true | ||
| types: [python] | ||
| - entry: poetry run summon format | ||
| id: formatters | ||
| language: system | ||
| name: Format | ||
| types: [python] | ||
| repo: local |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the test part is commented here, but the readme says to execute
summon testThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's commented on the CI because tests don't work without a
config.json. This is being worked on in another branch.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let it just on that other branch then? So this one keeps "clean".