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

Fail if the target document will be changed #30

Open
kumar303 opened this issue Jan 14, 2020 · 1 comment
Open

Fail if the target document will be changed #30

kumar303 opened this issue Jan 14, 2020 · 1 comment

Comments

@kumar303
Copy link

For the purpose of continuous integration (CI), I'd like a script that will fail (as in exit non-zero) when someone adds a new ADR record but forgets to update the table of contents.

It could look something like:

adr-log -d ./docs/adrs/ -i --disallow-changes

If that command would otherwise require updating / creating a file, it would fail. Such a failure probably indicates that the commit author forgot to re-generate the table of contents.

The current work around is something like this in a CI script:

adr-log -d ./docs/adrs/ -i 
# Check to see if any files were modified and exit non-zero:
git status ...

The workaround is not too bad but it requires relying on something like git within CI and some bash magic.

As a point of reference prettier --check exists for a similar use case.

@koppor
Copy link
Member

koppor commented Oct 21, 2020

Pull request welcome! #hacktoberfest

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

No branches or pull requests

2 participants