Skip to content

Enable yaml formatter; fix formatting in default-python & dbt-sql - #3026

Merged
denik merged 16 commits into
mainfrom
yaml_formatter
Jun 11, 2025
Merged

Enable yaml formatter; fix formatting in default-python & dbt-sql#3026
denik merged 16 commits into
mainfrom
yaml_formatter

Conversation

@denik

@denikdenik commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

Changes

  • Update 'make fmt' to format yaml with https://github.com/google/yamlfmt/
  • Templates dbt-sql and default-python updated to have consistent indentation according to formatter.

Why

For templates with a lot of options (default-python) it's easy to introduce formatting issues - too many empty lines or not enough in the output. I'd like to use formatter also on non-materialized templates in default-python/combinations to ensure that resulting yamls are formatted well for any possible combination of options. Related: #3004

@denik
deniktemporarily deployed to test-trigger-is June 10, 2025 14:37 — with GitHub Actions Inactive
@denik
deniktemporarily deployed to test-trigger-is June 10, 2025 14:39 — with GitHub Actions Inactive
@denik
deniktemporarily deployed to test-trigger-is June 10, 2025 15:31 — with GitHub Actions Inactive
@denikdenik changed the title Enable yaml formatterEnable yaml formatter; fix formatting in default-python & dbt-sqlJun 11, 2025
@denik
deniktemporarily deployed to test-trigger-is June 11, 2025 09:02 — with GitHub Actions Inactive
@denik
deniktemporarily deployed to test-trigger-is June 11, 2025 09:06 — with GitHub Actions Inactive
@denik
deniktemporarily deployed to test-trigger-is June 11, 2025 09:19 — with GitHub Actions Inactive
@denikdenik mentioned this pull request Jun 11, 2025
autoscale:
min_workers: 1
max_workers: 4
min_workers: 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are .yml.tmpl files automatically formatted?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is done manually.

Comment threadMakefile Outdated
tools/yamlfmt: go.mod
go build -o tools/yamlfmt github.com/google/yamlfmt/cmd/yamlfmt

yamlfmt: tools/yamlfmt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this a part of the normal make fmt rule rather than a separate one?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why not, 4490c23

Comment threadMakefile
ruff format -n
./tools/lintdiff.py fmt

# pre-building yamlfmt because I also want to call it from tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which test do you call it from?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

denik added a commit that referenced this pull request Jun 11, 2025
## Changes
Made ./tools/ available for acceptance tests.
## Why
Some tools are useful both in project and in tests, for example yamlfmt
(#3026) is useful to check
templates without materializing them
(#3032).
@denik
deniktemporarily deployed to test-trigger-is June 11, 2025 11:25 — with GitHub Actions Inactive
@denik
denik enabled auto-merge June 11, 2025 11:27
@denik
denik disabled auto-merge June 11, 2025 13:42
@denik
denik merged commit 4a1f1cd into mainJun 11, 2025
@denik
denik deleted the yaml_formatter branch June 11, 2025 13:42
deco-sdk-taggingBot added a commit that referenced this pull request Jun 11, 2025
## Release v0.255.0
### Notable Changes
* Fix `databricks auth login` to tolerate URLs copied from the browser ([#3001](#3001)).
### CLI
* Use OS aware runner instead of bash for run-local command ([#2996](#2996))
### Bundles
* Fix "bundle summary -o json" to render null values properly ([#2990](#2990))
* Fix dashboard generation for already imported dashboard ([#3016](#3016))
* Fixed null pointer de-reference if artifacts missing fields ([#3022](#3022))
* Update bundle templates to also include `resources/*/*.yml` ([#3024](#3024))
* Apply YAML formatter on default-python and dbt-sql templates ([#3026](#3026))
@denikdenik mentioned this pull request Jun 12, 2025
denik added a commit that referenced this pull request Jun 13, 2025

@pieternpietern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀🚀

# build: <second_option_command>
# build: <first_option_command>
# path: <path>
# build: <second_option_command>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is different from what I expected; when I uncomment these lines, they are incorrectly indented.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it does not do well on comments. I had to disable formatting of this one altogether (but forgot to undo changes) because it's not stable: google/yamlfmt#253

github-merge-queueBot pushed a commit that referenced this pull request Sep 26, 2025
## Why
The profiles file was incorrectly indented and made the example job run
fail.
The indentation change happened in #3026.
Fixes#3596.
## Tests
Initialized the template and successfully ran the job.
denik added a commit that referenced this pull request May 20, 2026
## Changes
Made ./tools/ available for acceptance tests.
## Why
Some tools are useful both in project and in tests, for example yamlfmt
(#3026) is useful to check
templates without materializing them
(#3032).
denik added a commit that referenced this pull request May 20, 2026
)
## Changes
- Update 'make fmt' to format yaml with
https://github.com/google/yamlfmt/
- Templates dbt-sql and default-python updated to have consistent
indentation according to formatter.
## Why
For templates with a lot of options (default-python) it's easy to
introduce formatting issues - too many empty lines or not enough in the
output. I'd like to use formatter also on non-materialized templates in
default-python/combinations to ensure that resulting yamls are formatted
well for any possible combination of options. Related:
#3004
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.255.0
### Notable Changes
* Fix `databricks auth login` to tolerate URLs copied from the browser ([#3001](#3001)).
### CLI
* Use OS aware runner instead of bash for run-local command ([#2996](#2996))
### Bundles
* Fix "bundle summary -o json" to render null values properly ([#2990](#2990))
* Fix dashboard generation for already imported dashboard ([#3016](#3016))
* Fixed null pointer de-reference if artifacts missing fields ([#3022](#3022))
* Update bundle templates to also include `resources/*/*.yml` ([#3024](#3024))
* Apply YAML formatter on default-python and dbt-sql templates ([#3026](#3026))
denik added a commit that referenced this pull request May 20, 2026
denik pushed a commit that referenced this pull request May 20, 2026
## Why
The profiles file was incorrectly indented and made the example job run
fail.
The indentation change happened in #3026.
Fixes#3596.
## Tests
Initialized the template and successfully ran the job.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@denik@pietern@shreyas-goenka