-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: properly format files and re-run formatters on the repo (#112)
Runs formatters on the repository as they were meant to be configured as well adds `linters` Github Action group that ensures that formatters were ran as well as code/doc generators. Enables tabs instead of spaces across the entire repository because they use less space and any modern editor should be configured to display them to their liking. The only exception is YAML which has to be spaces. We output `2` for the least amount as well as it being my preference (again, configure your editor if you haven't already, if you don't like 2).
- Loading branch information
1 parent
d89c704
commit 5daa92d
Showing
45 changed files
with
418 additions
and
389 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,17 +1,13 @@ | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.go,Makefile] | ||
max_line_length = 72 | ||
indent_style = tab | ||
|
||
[*.{bash,rb,sh,slim,yml,yaml}] | ||
# yaml is forced to use spaces :/ | ||
[*.{yml,yaml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
## <<Stencil::Block(editorconfig)>> | ||
|
||
## <</Stencil::Block>> |
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,6 @@ | ||
# Documentation can be found at: | ||
# https://github.com/repository-settings/app/blob/master/docs/configuration.md | ||
_extends: jaredallard/jaredallard:settings.yml | ||
|
||
## <<Stencil::Block(custom)>> | ||
|
||
## <</Stencil::Block>> | ||
## <</Stencil::Block>> |
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 @@ | ||
name: linters | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-generated-files-and-fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jdx/mise-action@v2 | ||
with: | ||
experimental: true | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Get Go directories | ||
id: go | ||
run: | | ||
echo "cache_dir=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" | ||
echo "mod_cache_dir=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.go.outputs.cache_dir }} | ||
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.go.outputs.mod_cache_dir }} | ||
key: ${{ runner.os }}-go-mod-cache-${{ hashFiles('**/go.sum') }} | ||
- name: Setup prettier | ||
run: bun install | ||
- run: mise run generate | ||
- run: mise run fmt | ||
- name: Check for changes | ||
run: |- | ||
git diff --exit-code HEAD || \ | ||
( echo \ | ||
&& echo "Formatting issues or stale documentation found. Please run the 'generate' and 'fmt' tasks." \ | ||
&& exit 1) | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jdx/mise-action@v2 | ||
with: | ||
experimental: true | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Retrieve golangci-lint version | ||
run: | | ||
echo "version=$(mise current golangci-lint)" >> "$GITHUB_OUTPUT" | ||
id: golangci_lint | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v${{ steps.golangci_lint.outputs.version }} | ||
args: --timeout=30m |
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,10 +1,10 @@ | ||
{ | ||
"recommendations": [ | ||
"editorconfig.editorconfig", | ||
"esbenp.prettier-vscode", | ||
"golang.go", | ||
"timonwong.shellcheck", | ||
"redhat.vscode-yaml", | ||
"foxundermoon.shell-format" | ||
] | ||
"recommendations": [ | ||
"editorconfig.editorconfig", | ||
"esbenp.prettier-vscode", | ||
"golang.go", | ||
"timonwong.shellcheck", | ||
"redhat.vscode-yaml", | ||
"foxundermoon.shell-format" | ||
] | ||
} |
Oops, something went wrong.