-
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.
Add trunk, fix autofixable lint & format errors & check for FIXMEs on…
… PR (#96)
- Loading branch information
1 parent
fceac82
commit 6ce2761
Showing
127 changed files
with
505 additions
and
387 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 |
---|---|---|
|
@@ -2,47 +2,33 @@ name: CI/CD | |
|
||
on: | ||
push: | ||
tags: ['v*'] | ||
tags: ["v*"] | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: read-all | ||
|
||
# https://github.com/marketplace/actions/docker-layer-caching | ||
jobs: | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install "poetry==1.6.1" && poetry install && poetry run pre-commit install | ||
- name: Run pre-commit checks | ||
run: | | ||
poetry run pre-commit run --all-files | ||
- name: Check code contains no FIXME's | ||
run: | | ||
git grep -r --no-color ${case_sensitive} --line-number -e "FIXME" :^.github | ||
if [[ $? -eq 0 ]]; then | ||
# if we found any FIXME entries in checked in files, fail on main | ||
exit 1 | ||
else | ||
exit 0 | ||
fi | ||
shell: bash {0} | ||
permissions: | ||
# For trunk to post annotations | ||
checks: write | ||
# For repo checkout | ||
contents: read | ||
uses: climatepolicyradar/reusable-workflows/.github/workflows/python-precommit-validator.yml@main | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install latest Docker Compose | ||
uses: ndeloof/[email protected] | ||
with: | ||
legacy: false | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Configure test env variables | ||
|
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 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,4 @@ | ||
# Following source doesn't work in most setups | ||
ignored: | ||
- SC1090 | ||
- SC1091 |
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,2 @@ | ||
[settings] | ||
profile=black |
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,11 @@ | ||
# Autoformatter friendly markdownlint config (all formatting rules disabled) | ||
default: true | ||
blank_lines: false | ||
bullet: false | ||
html: false | ||
indentation: false | ||
line_length: false | ||
spaces: false | ||
url: false | ||
whitespace: false | ||
tables: false |
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,7 @@ | ||
enable=all | ||
source-path=SCRIPTDIR | ||
disable=SC2154 | ||
|
||
# If you're having issues with shellcheck following source, disable the errors via: | ||
# disable=SC1090 | ||
# disable=SC1091 |
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,10 @@ | ||
rules: | ||
quoted-strings: | ||
required: only-when-needed | ||
extra-allowed: ["{|}"] | ||
empty-values: | ||
forbid-in-block-mappings: true | ||
forbid-in-flow-mappings: true | ||
key-duplicates: {} | ||
octal-values: | ||
forbid-implicit-octal: true |
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 @@ | ||
exclude_dirs: ["unit_tests", "integration_tests"] |
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,4 @@ | ||
version: "0.2" | ||
# Suggestions can sometimes take longer on CI machines, | ||
# leading to inconsistent results. | ||
suggestionsTimeout: 5000 # ms |
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,67 @@ | ||
# This file controls the behavior of Trunk: https://docs.trunk.io/cli | ||
# | ||
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml | ||
version: 0.1 | ||
cli: | ||
version: 1.20.1 | ||
|
||
# Trunk provides extensibility via plugins. | ||
# (https://docs.trunk.io/plugins) | ||
plugins: | ||
sources: | ||
- id: trunk | ||
ref: v1.4.4 | ||
uri: https://github.com/trunk-io/plugins | ||
|
||
# Many linters and tools depend on runtimes - configure them here. | ||
# (https://docs.trunk.io/runtimes) | ||
runtimes: | ||
enabled: | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
|
||
# This is the section where you manage your linters. | ||
# (https://docs.trunk.io/check/configuration) | ||
lint: | ||
definitions: | ||
- name: bandit | ||
direct_configs: [bandit.yaml] | ||
commands: | ||
- name: lint | ||
run: bandit --exit-zero -c bandit.yaml --format json --output ${tmpfile} ${target} | ||
|
||
enabled: | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- git-diff-check | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected]: | ||
commands: | ||
- end-of-file-fixer | ||
- check-json | ||
- detect-aws-credentials | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
|
||
actions: | ||
disabled: | ||
- trunk-announce | ||
- trunk-check-pre-push | ||
enabled: | ||
- trunk-check-pre-commit | ||
- trunk-fmt-pre-commit | ||
- trunk-upgrade-available |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from .family import families_router | ||
from .collection import collections_router | ||
from .analytics import analytics_router | ||
from .auth import auth_router | ||
from .document import document_router | ||
from .collection import collections_router | ||
from .config import config_router | ||
from .analytics import analytics_router | ||
from .document import document_router | ||
from .event import event_router | ||
from .family import families_router |
Oops, something went wrong.