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

Add a "DO NOT EDIT" comment to failpoint-enabled source code #37

Closed
kennytm opened this issue Jun 15, 2019 · 2 comments · Fixed by #39
Closed

Add a "DO NOT EDIT" comment to failpoint-enabled source code #37

kennytm opened this issue Jun 15, 2019 · 2 comments · Fixed by #39
Labels
enhancement New feature or request

Comments

@kennytm
Copy link
Contributor

kennytm commented Jun 15, 2019

Feature Request

Is your feature request related to a problem? Please describe:

Although failpoint-ctl disable will automatically apply diff when the original source is changed, this doesn't always work, and it would be frustrating to be stuck in a state where failpoint-ctl disable cannot proceed and you've got some changes hard to be extracted.

Most editors supporting Go recognize the generated source indicator and warns when you try to edit the file, thus preventing the need to merge diffs in the first place.

Describe the feature you'd like:

In the source code generated by failpoint-ctl enable (all of the rewritten *.go, *__failpoint_binding__.go, and *.go__failpoint_stash__), insert this comment on first line:

// Code generated by failpoint DO NOT EDIT.

Remove this line after failpoint-ctl disable.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Optimization:

@lonng
Copy link
Contributor

lonng commented Jun 20, 2019

Can you file a PR for this feature? @kennytm

@lonng lonng added the enhancement New feature or request label Jun 20, 2019
@kennytm
Copy link
Contributor Author

kennytm commented Jun 20, 2019

Yeah when I've got time to do it 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants