-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(remove): Wrap controlled patterns in comment block #4
Conversation
BREAKING CHANGE: Now has a head and trailing comment which creates a block of controlled patterns. Anything in the comment block will be re-written on each run of the script
? [`\n${startComment}`, ...sortedPatterns, endComment] | ||
: []; | ||
|
||
const outputPatterns = [...before, ...controlledPatterns, ...after] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏻👏🏻👏🏻
README.md
Outdated
|
||
Prepended to the list of provided pattens at the bottom of the file, to indicate which patterns are being controlled programmatically. | ||
Allows you to document the list of patterns that are being controlled programmatically. This helps provide context as to why/what is controlling certain patterns within a `.gitignore` file. Anything inside the comment block will be re-written on each run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to document that this option is required if you want to be able to remove controlled patterns? Otherwise, this looks like it's merely cosmetic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given there is a default comment you get the removal behaviour out of the box rather than an opt-in. There is no way to opt-out of the block style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, gotcha. So should we make it mandatory? Right now it's ?string
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore me. I need more coffee.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-Authored-By: michaeltaranto <michael.taranto@gmail.com>
Supports removing controlled patterns from
.gitignore
. The patterns are now written to the.gitignore
file inside a comment block. This block is re-written on every run of the script, so any manual changes to the patterns inside the block will be discarded on subsequent runs.