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

Document some thoughts on creating config files #135

Open
nathanjmcdougall opened this issue Nov 20, 2024 · 0 comments
Open

Document some thoughts on creating config files #135

nathanjmcdougall opened this issue Nov 20, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@nathanjmcdougall
Copy link
Owner

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.

@nathanjmcdougall nathanjmcdougall added the documentation Improvements or additions to documentation label Nov 20, 2024
@nathanjmcdougall nathanjmcdougall self-assigned this Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant