dbt-labs / dbt-postgres

Apache License 2.0
34 stars 14 forks source link

Adding yamlfix formatter #143

Open leahwicz opened 3 months ago

leahwicz commented 3 months ago

resolves #137

Problem

Have a linter and formatter for GitHub workflows

Solution

This is an alternative formatter to the one proposed here: https://github.com/dbt-labs/dbt-postgres/pull/141

leahwicz commented 3 months ago

@mikealfare so I dug a little more after the comments you left on draft PR https://github.com/dbt-labs/dbt-postgres/pull/141 and I think I found a better solution. You mentioned long/short list form which my original proposal did not have an option to enforce. I ended up finding yamlfix as an alternative where we can be flexible with the configuration and it also will autofix things for you. If you like this option instead, I can pursue implementing this one instead with whatever configurations that we would want to enforce.

leahwicz commented 2 months ago

First, it would be nice if yamlfix supported command line args so that we could avoid the separate config file. It's nice having all of this config in one place in .pre-commit-config.yaml.

@mikealfare we can't pass the configuration in as args unfortunately (I know it seems odd). The other alternative is placing them in the pyproject.toml that already exists so we could consolidate to that file as an option.

Second, I need to see if we can use this tool since it's GNU GPLv3. This license combines with the Apache License, but the result needs to be licensed under GNU GPLv3. We're not actually shipping it as part of the product, but it's contributing to the quality of it. I'll consult internally to see.

Also, good call on the license. This was just an idea so we can go back to the original proposal https://github.com/dbt-labs/dbt-postgres/pull/141 if that is better. Just let me know what makes sense to everyone. I'm happy to do either way.