Git Product home page Git Product logo

Comments (6)

tomasbjerre avatar tomasbjerre commented on June 27, 2024

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

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 27, 2024

You may say that you encourage the boy scout rule =) So developers should clean up any file they touch.

from violation-comments-to-stash-plugin.

tuukkamustonen avatar tuukkamustonen commented on June 27, 2024

You may say that you encourage the boy scout rule =)

Ha πŸ˜„! I guess it's feasible and circumvents the problem.

I'm not really familiar with Atlassian APIs, but doesn't /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff at Bitbucket server REST API (anchors don't appear to work on that page so no direct link) seem to drive the need?

Documentation is a bit misleading, as you would first think that srcPatch is required parameter, but it actually isn't.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 27, 2024

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 http://localhost:7990/rest/api/1.0/projects/TOM/repos/violations-test/pull-requests/1/diff.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 27, 2024

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.

from violation-comments-to-stash-plugin.

tuukkamustonen avatar tuukkamustonen commented on June 27, 2024

Sounds feasible, I'll give it a try. Thanks again!

from violation-comments-to-stash-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.