Title: Document some thoughts on creating config files · Issue #135 · usethis-python/usethis-python · GitHub
Open Graph Title: Document some thoughts on creating config files · Issue #135 · usethis-python/usethis-python
X Title: Document some thoughts on creating config files · Issue #135 · usethis-python/usethis-python
Description: 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'...
Open Graph Description: 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. ...
X Description: 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, e...
Opengraph URL: https://github.com/usethis-python/usethis-python/issues/135
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Document some thoughts on creating config files","articleBody":"**Motivation**\r\nI have done some thinking on creating config files.\r\n\r\nSome 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).\r\n\r\nAfter some thinking, I've decided on the following principles for these sorts of functions.\r\n\r\n- If a config file has compulsory contents, then the create-file function should accept a content item as an argument\r\n- In the add-contents functions, if the file does not exist, it can be created with the content item passed as an argument.\r\n- 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.\r\n- add-contents functions should remove placeholder content items if they are detected.\r\n- Placeholder items should be named and structured as similarly as possible between config files.\r\n\r\n**Summary of desired enhancement**\r\nThe above principles should be explained more clearly and documented somewhere.\r\n","author":{"url":"https://github.com/nathanjmcdougall","@type":"Person","name":"nathanjmcdougall"},"datePublished":"2024-11-20T04:21:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/135/usethis-python/issues/135"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ba6acd1e-5e21-c805-1c2f-38b7df8d52a0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 877E:1CB805:BFDEBE:1083002:6A4DC6A2 |
| html-safe-nonce | 51dbfbd2fcd1152c0551b6404ff3641ea3da3438c94e2f764da723a711fb347c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzdFOjFDQjgwNTpCRkRFQkU6MTA4MzAwMjo2QTREQzZBMiIsInZpc2l0b3JfaWQiOiI2OTk2NDEzNTIxMjI0MTI0MDY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7ef455fbef4009bba55a29aaf4ede060f7282c14d3c26dd2ee5a772769b12d3d |
| hovercard-subject-tag | issue:2674295821 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/usethis-python/usethis-python/135/issue_layout |
| twitter:image | https://opengraph.githubassets.com/52416a41c0f2e3349d479407e2a878d3bd2b3028b7c9272134af725c265da99d/usethis-python/usethis-python/issues/135 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/52416a41c0f2e3349d479407e2a878d3bd2b3028b7c9272134af725c265da99d/usethis-python/usethis-python/issues/135 |
| og:image:alt | 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. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nathanjmcdougall |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width