-
Notifications
You must be signed in to change notification settings - Fork 21
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
Comment only violations that relate to a diff #27
Comments
Yes that would be better. I did not manage to figure out how to determine if a reported line is changed in the pull request, or not. The GitHub API was easier. There I made it optional to comment all changed files, or comment only changed parts of files: https://github.com/tomasbjerre/violation-comments-to-github-lib/blob/master/src/main/java/se/bjurr/violations/comments/github/lib/GitHubCommentsProvider.java#L112 |
You may say that you encourage the boy scout rule =) So developers should clean up any file they touch. |
Ha 😄! I guess it's feasible and circumvents the problem. I'm not really familiar with Atlassian APIs, but doesn't Documentation is a bit misleading, as you would first think that |
I think it works now in 1.34 but I did not have time to test it alot. Lines can be reported as ADDED, REMOVED or CONTEXT. I decided to include ADDED and CONTEXT. Because a change on line 10 may trigger a violation on line 9... And to check if a line is in CONTEXT, the rest call is something like |
Actually I changed it again. 1.35 only includes ADDED. And there is a field, context, for specifying how many lines surrounding an added line that should be included. |
Sounds feasible, I'll give it a try. Thanks again! |
It seems like the plugin now writes all violation comments that relate to a file in the diff.
The comments that don't have actual diff are left in the Overview-tab in the main stream (instead of showing up under Diff-tab).
It would be better to write just those comments, that relate to code that was actually changed?
The text was updated successfully, but these errors were encountered: