You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation
I have done some thinking on creating config files.
Some config files can't be empty, e.g. pre-commit config, Bitbucket pipelines. There has to be at least one hook, pipeline step, etc. (content items).
After some thinking, I've decided on the following principles for these sorts of functions.
If a config file has compulsory contents, then the create-file function should accept a content item as an argument
In the add-contents functions, if the file does not exist, it can be created with the content item passed as an argument.
If the config file is expected to exist (e.g. pre-commit can't install commits from an empty file) but the tool has no reason to call add-contents (e.g. we have no tools with pre-commits configured yet), then we should add a placeholder content item. Otherwise, we should not add the placeholder item.
add-contents functions should remove placeholder content items if they are detected.
Placeholder items should be named and structured as similarly as possible between config files.
Summary of desired enhancement
The above principles should be explained more clearly and documented somewhere.
The text was updated successfully, but these errors were encountered:
Motivation
I have done some thinking on creating config files.
Some config files can't be empty, e.g.
pre-commit
config, Bitbucket pipelines. There has to be at least one hook, pipeline step, etc. (content items).After some thinking, I've decided on the following principles for these sorts of functions.
Summary of desired enhancement
The above principles should be explained more clearly and documented somewhere.
The text was updated successfully, but these errors were encountered: