-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore(ci): Add yaml and action formatter/linter to CI #1899
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
kakkoyun
wants to merge
6
commits into
prometheus:main
Choose a base branch
from
kakkoyun:chore/actionlint
base: main
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
6 commits
Select commit
Hold shift + click to select a range
cda1fdc
chore(ci): Add CRLF detection and fix targets to prevent CRLF contami…
kakkoyun 3800ec2
chore(go/fmt): Fix formatting issues
kakkoyun 3e711e9
chore(ci): Add yaml and action formatter/linter to CI
kakkoyun a28ea0c
chore(.github/workflows): Fix action formats and issues
kakkoyun 431ed50
chore(make): Uses common actiosn
kakkoyun 6b8b8dd
fix: format
kakkoyun 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,2 @@ | ||
| # actionlint configuration | ||
| # https://github.com/rhysd/actionlint/blob/main/docs/config.md |
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 |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| --- | ||
| branches: | ||
| - name: main | ||
| protection: | ||
|
|
||
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
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
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
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
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
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 |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| --- | ||
| name: Generate Metric files for new Go version | ||
|
|
||
| on: | ||
|
|
||
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 |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| --- | ||
| name: Validate | ||
| on: | ||
| pull_request: | ||
|
|
@@ -22,16 +21,16 @@ jobs: | |
| name: Fetch supported Go versions | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| supported_versions: ${{ steps.matrix.outputs.supported_versions }} | ||
| supported_versions: ${{ steps.matrix.outputs.supported_versions }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - name: Read supported_go_versions.txt | ||
| id: matrix | ||
| run: | | ||
| versions=$(cat supported_go_versions.txt) | ||
| matrix="[$(echo "$versions" | sed 's/\(.*\)/"\1"/' | paste -s -d,)]" | ||
| echo "supported_versions=$matrix" >> $GITHUB_OUTPUT | ||
| versions=$(cat supported_go_versions.txt) | ||
| matrix="[$(echo "$versions" | sed 's/\(.*\)/"\1"/' | paste -s -d,)]" | ||
| echo "supported_versions=$matrix" >> "$GITHUB_OUTPUT" | ||
|
|
||
| test: | ||
| name: Tests (${{ matrix.go_version }}) | ||
|
|
@@ -69,3 +68,22 @@ jobs: | |
| - name: Run style and unused | ||
| if: ${{ matrix.go_version == '1.22' }} | ||
| run: make style unused | ||
|
|
||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/[email protected] | ||
| with: | ||
| go-version: stable | ||
| check-latest: true | ||
|
|
||
| - name: Lint YAML files | ||
| run: make lint-yaml | ||
|
|
||
| - name: Lint GitHub Actions workflows | ||
| run: make lint-actions | ||
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,17 @@ | ||
| # yamlfmt configuration | ||
| # https://github.com/google/yamlfmt | ||
|
|
||
| doublestar: true | ||
|
|
||
| exclude: | ||
| - "**/testdata/**" | ||
| - "**/*testdata*/**" | ||
|
|
||
| gitignore_excludes: true | ||
|
|
||
| formatter: | ||
| type: basic | ||
| indent: 2 | ||
| include_document_start: false | ||
| retain_line_breaks: true | ||
| max_line_length: 0 |
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,25 @@ | ||
| --- | ||
| extends: default | ||
| ignore: | | ||
| **/node_modules | ||
|
|
||
| rules: | ||
| braces: | ||
| max-spaces-inside: 1 | ||
| level: error | ||
| brackets: | ||
| max-spaces-inside: 1 | ||
| level: error | ||
| commas: disable | ||
| comments: disable | ||
| comments-indentation: disable | ||
| document-start: disable | ||
| indentation: | ||
| spaces: consistent | ||
| indent-sequences: consistent | ||
| key-duplicates: | ||
| ignore: | | ||
| config/testdata/section_key_dup.bad.yml | ||
| line-length: disable | ||
| truthy: | ||
| check-keys: false |
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
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
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
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 |
|---|---|---|
|
|
@@ -90,7 +90,7 @@ loop: | |
| s = skipSpace(s[1:]) | ||
| } | ||
| } | ||
| return | ||
| return specs | ||
| } | ||
|
|
||
| func skipSpace(s string) (rest string) { | ||
|
|
||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.