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 patch markers to patched code #69

Open
allanpaiste opened this issue Feb 22, 2021 · 0 comments
Open

Add patch markers to patched code #69

allanpaiste opened this issue Feb 22, 2021 · 0 comments

Comments

@allanpaiste
Copy link
Contributor

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

In case one is working on a large-scale project or works in an agency where the patching of project is handled by a specific core team - there might be cases where someone in a project team ends up relying on a piece of code/logic that has been introduced by a patch. Because the production code does not have any indicators that some rows were patched in (unless patch author has taken care of this), it takes extra effort to check this.

Describe the solution you'd like

Introduce mechanism that would automatically add comments near the patched in code. Might be reference to the file and package that owns the patch.

This would be somewhat tricky to achieve as the comments have to be removed in case there are multiple patches targeting the same part of the code (or that layer on top of each other -- something that is not out-of-this-world scenario when the patches are managed in relatively granular manner).

Describe alternatives you've considered

Enforcing comments in patches would be another way to achieve this (where the patch applier would just error out when patch does not introduce such contextual comments). Not very convenient though.

One could also consider erroring out when patch removes part of code without adding anything - which might be confusing as well (in this case the validator could require a one-liner replacement)

Additional context

This could be considered somewhat edge-case'y and might not be something that the main plugin needs, but have experienced situations where production code becomes very much unintentionally dependent on the patched-in code.

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

No branches or pull requests

1 participant