-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from amplify-education/AT-8092-code-style-upd…
…ates Remove pycodestyle, add black, add numerous pre-commit checks.
- Loading branch information
Showing
29 changed files
with
274 additions
and
4,961 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
engines: | ||
coverage: | ||
enabled: true | ||
excluded_paths: | ||
- test/** | ||
coverage: | ||
enabled: true | ||
excluded_paths: | ||
- test/** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
--- | ||
name: Publish | ||
on: | ||
release: | ||
types: [released] | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
build-publish: | ||
name: Build and publish Python distributions | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: python -m pip install --upgrade pip build | ||
- name: Generate Lark Parser | ||
run: | | ||
pip install -r requirements.txt -e . | ||
python hcl2/parser.py | ||
- name: Build tarball | ||
run: python3 -m build | ||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
build-publish: | ||
name: Build and publish Python distributions | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: python -m pip install --upgrade pip build | ||
- name: Generate Lark Parser | ||
run: | | ||
pip install -r requirements.txt -e . | ||
python hcl2/parser.py | ||
- name: Build tarball | ||
run: python3 -m build | ||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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,45 @@ | ||
--- | ||
# 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.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-added-large-files | ||
- id: no-commit-to-branch # Prevent commits directly to master | ||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.28.0 | ||
hooks: | ||
- id: yamllint | ||
name: Lint YAML | ||
args: [--format, parsable, --strict] | ||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
rev: 0.2.2 # or specific tag | ||
hooks: | ||
- id: yamlfmt | ||
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '120'] | ||
- repo: https://github.com/executablebooks/mdformat.git | ||
rev: 0.7.16 | ||
hooks: | ||
- id: mdformat | ||
name: Format markdown | ||
- repo: https://github.com/psf/black | ||
rev: 22.8.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.8 | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.991 # Use the sha / tag you want to point at | ||
hooks: | ||
- id: mypy | ||
- repo: local | ||
hooks: | ||
- id: pylint | ||
name: pylint (Python Linting) | ||
entry: pylint | ||
language: system | ||
types: [python] | ||
files: ^(hcl2|test)/ | ||
args: [--rcfile=pylintrc, --output-format=colorized, --score=no] |
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,8 @@ | ||
--- | ||
# https://yamllint.readthedocs.io/en/stable/configuration.html#extending-the-default-configuration | ||
|
||
extends: relaxed | ||
rules: | ||
line-length: | ||
max: 120 | ||
hyphens: disable |
Oops, something went wrong.