Skip to content
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

Allow YML extension in addition to YAML #133

Open
apd-bbaker opened this issue Oct 15, 2024 · 4 comments
Open

Allow YML extension in addition to YAML #133

apd-bbaker opened this issue Oct 15, 2024 · 4 comments

Comments

@apd-bbaker
Copy link

apd-bbaker commented Oct 15, 2024

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
It would be great to allow YML as well as YAML file extensions as both are commonly found in codebases. It's tripped us up a bit when we realize we missed a keystroke in the filename and spent a lot of time troubleshooting the object only to realize it was that simple difference.

Describe alternatives you've considered
N/A

Additional context
I'd like to take a crack at the code change for this issue as it seems fairly straightforward.

@littleK0i
Copy link
Owner

littleK0i commented Oct 15, 2024

It is an interesting topic.

In theory, it should be easy to update the code to support both YAML and YML. But it would quickly lead to unintended consequences with configs having mixture of extensions. Some files will be .yaml and other files will be .yml, unless we use pre-commit hook or linter. This naturally creates mess, and we want to avoid mess.

Another possible option is to add CLI parameter which allows to change extension entirely and ask all config files to be .yml. But now we need to remember about one more parameter, and configs become less portable overall. It becomes harder to copy & paste or share parts of config.

In the end, it might be easier to stick with officially recommended .yaml extension and call it a day. Ultimately, I would blame people responsible for standards for not strictly enforcing one way or another.

@apd-bbaker
Copy link
Author

YAML/YML doesn't make much difference in my mind so prefer the option to choose one or the other based on preference of the team building the solution. What about a middle ground - a warning that detects YML extensions and warns that it should be renamed? That would do a little more for enforcement than just ignoring them.

@littleK0i
Copy link
Owner

In theory, we can go further and highlight all files which exist in config directory, but were never picked up by any parsers. It would help to find all types of naming mistakes, not only extensions.

The only problem is.. I know some people use underscore to "comment" some directories with object types. E.g. rename table to _table, and it causes SnowDDL to ignore this part. Guess it will no longer be possible.

Maybe we can add it as an option or as a pre-commit hook for Git.

@apd-bbaker
Copy link
Author

@littleK0i My concern is that this places a hard dependency on Git to do the work of app validation logic, which can lead down a dangerous path when logic becomes more complex later. It seems cleaner and more contained to have the app perform these sorts of validations as part of the general structure checks ahead of parsing the yaml files, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants