-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add pre-commit linters, autoformatters (#299)
* Add pre-commit linters, formatters Signed-off-by: Yuki Sawa <[email protected]> * add descriptive name for fail msg step Signed-off-by: Yuki Sawa <[email protected]> * shorten precommit makefile cmd Signed-off-by: Yuki Sawa <[email protected]> * make fix_format Signed-off-by: Yuki Sawa <[email protected]> * autoformat all lint errs Signed-off-by: Yuki Sawa <[email protected]> * backtick quote to avoid formatter Signed-off-by: Yuki Sawa <[email protected]> * add shfmt for bash linting Signed-off-by: Yuki Sawa <[email protected]>
- Loading branch information
Showing
64 changed files
with
552 additions
and
339 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
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,42 +1,42 @@ | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 */4 * * *' | ||
- cron: "0 */4 * * *" | ||
|
||
jobs: | ||
prune_stale: | ||
name: Prune Stale | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Prune Stale | ||
uses: actions/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
# Different amounts of days for issues/PRs are not currently supported but there is a PR | ||
# open for it: https://github.com/actions/stale/issues/214 | ||
days-before-stale: 30 | ||
days-before-close: 7 | ||
stale-issue-message: > | ||
This issue has been automatically marked as stale because it has not had activity in the | ||
last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity | ||
occurs. Thank you for your contributions. | ||
close-issue-message: > | ||
This issue has been automatically closed because it has not had activity in the | ||
last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". | ||
Thank you for your contributions. | ||
stale-pr-message: > | ||
This pull request has been automatically marked as stale because it has not had | ||
activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please | ||
feel free to give a status update now, ping for review, or re-open when it's ready. | ||
Thank you for your contributions! | ||
close-pr-message: > | ||
This pull request has been automatically closed because it has not had | ||
activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. | ||
Thank you for your contributions! | ||
stale-issue-label: 'stale' | ||
exempt-issue-labels: 'no stalebot,help wanted' | ||
stale-pr-label: 'stale' | ||
exempt-pr-labels: 'no stalebot' | ||
operations-per-run: 500 | ||
ascending: true | ||
- name: Prune Stale | ||
uses: actions/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
# Different amounts of days for issues/PRs are not currently supported but there is a PR | ||
# open for it: https://github.com/actions/stale/issues/214 | ||
days-before-stale: 30 | ||
days-before-close: 7 | ||
stale-issue-message: > | ||
This issue has been automatically marked as stale because it has not had activity in the | ||
last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity | ||
occurs. Thank you for your contributions. | ||
close-issue-message: > | ||
This issue has been automatically closed because it has not had activity in the | ||
last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". | ||
Thank you for your contributions. | ||
stale-pr-message: > | ||
This pull request has been automatically marked as stale because it has not had | ||
activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please | ||
feel free to give a status update now, ping for review, or re-open when it's ready. | ||
Thank you for your contributions! | ||
close-pr-message: > | ||
This pull request has been automatically closed because it has not had | ||
activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. | ||
Thank you for your contributions! | ||
stale-issue-label: "stale" | ||
exempt-issue-labels: "no stalebot,help wanted" | ||
stale-pr-label: "stale" | ||
exempt-pr-labels: "no stalebot" | ||
operations-per-run: 500 | ||
ascending: 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,31 @@ | ||
default_language_version: | ||
python: python3 | ||
repos: | ||
- repo: https://github.com/tekwizely/pre-commit-golang | ||
rev: v1.0.0-beta.4 | ||
hooks: | ||
- id: go-imports | ||
args: ["-w", "-local", "github.com/envoyproxy/ratelimit"] | ||
- id: go-fumpt | ||
args: ["-w"] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v2.4.1" | ||
hooks: | ||
- id: prettier | ||
exclude: "test/config/bad_yaml.yaml" | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/jumanjihouse/pre-commit-hooks | ||
rev: 2.1.5 | ||
hooks: | ||
- id: shfmt |
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 @@ | ||
singleQuote: 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
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 |
---|---|---|
|
@@ -114,8 +114,14 @@ docker_image: docker_tests | |
docker_push: docker_image | ||
docker push $(IMAGE):$(VERSION) | ||
|
||
.PHONY: integration-tests | ||
integration-tests: | ||
.PHONY: integration_tests | ||
integration_tests: | ||
docker-compose --project-dir $(PWD) -f integration-test/docker-compose-integration-test.yml up --build --exit-code-from tester | ||
|
||
# docker-compose --project-dir $(PWD) -f integration-test/docker-compose-integration-test.yml up --build --exit-code-from tester | ||
.PHONY: precommit_install | ||
precommit_install: | ||
python3 -m pip install -r requirements-dev.txt | ||
go install mvdan.cc/[email protected] | ||
go install mvdan.cc/sh/v3/cmd/shfmt@latest | ||
go install golang.org/x/tools/cmd/[email protected] | ||
pre-commit install |
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,2 +1,2 @@ | ||
* Matt Klein ([mattklein123](https://github.com/mattklein123)) ([email protected]) | ||
* Yuki Sawa ([ysawa0](https://github.com/ysawa0)) ([email protected]) | ||
- Matt Klein ([mattklein123](https://github.com/mattklein123)) ([email protected]) | ||
- Yuki Sawa ([ysawa0](https://github.com/ysawa0)) ([email protected]) |
Oops, something went wrong.