-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(yaml): autofix YAML files (#431)
- Loading branch information
1 parent
101ece9
commit d8cc4b1
Showing
35 changed files
with
491 additions
and
124 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
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 was deleted.
Oops, something went wrong.
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,39 @@ | ||
# JMESPath as part of the section name, after the file name. | ||
# Everything after the file name is considered a JMESPath https://jmespath.org/ | ||
# Format: ["path/to/file.ext".jmes.path.expression] | ||
# The values below were taken from .github/workflows/python.yaml in this repo | ||
|
||
# 1. Complex JMESPath expressions should be quoted | ||
# (I still don't know how to deal with JMESPath that matches multiple items) | ||
[[".github/workflows/python.yaml"."jobs.build.steps[].{name: name, uses: uses}"]] | ||
uses = "actions/checkout@v2" | ||
|
||
# 2. JMESPath expression that has double quotes, wrapped in single quotes for TOML | ||
[[".github/workflows/python.yaml".'jobs.build.strategy.matrix."python-version"']] | ||
name = "Set up Python ${{ matrix.python-version }}" | ||
uses = "actions/setup-python@v2" | ||
with = {"python-version" = "${{ matrix.python-version }}"} | ||
|
||
# 3. It allows Jinja tuning in https://github.com/andreoliwa/nitpick/issues/283 | ||
name__jinja = "Set up Python ${{ matrix.python-version }}" | ||
name__no_jinja = "Set up Python ${{ matrix.python-version }}" | ||
name__jinja_off = "Set up Python ${{ matrix.python-version }}" | ||
|
||
# 4. "{{" and "}}" will conflict with Jinja https://github.com/andreoliwa/nitpick/issues/283 | ||
# So we need a way to turn on/off Jinja templating. | ||
# Probably "false" will be the default, to keep compatibility. | ||
# Whoever wants to use Jinja will need to set "true" either here or as a global config on .nitpick.toml | ||
[".github/workflows/python.yaml".jobs.build] | ||
__jinja = false | ||
|
||
# 5. Another way to turn off Jinja for a specific key only, not the whole dict | ||
# (using the "__" syntax from Django filters, SQLAlchemy, factoryboy...) | ||
"runs-on__no_jinja" = "${{ matrix.os }}" | ||
|
||
# 6. Simplified API, having JMESPath as direct keys | ||
# Read the discussion: https://github.com/andreoliwa/nitpick/pull/353/files#r613816390 | ||
[".github/workflows/jmespath-simple.yaml"] | ||
"jobs.build.strategy.matrix.os" = "foo" | ||
"jobs.build.steps" = ["bar"] | ||
"jobs.build.steps.regex" = "baz d+" | ||
"jobs.build.steps.contains" = "baz" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Oops, something went wrong.