Findbugs for Git Pull Request

Malik Atalla

Is there a way to setup Findbugs (or any other static code analysis tool) in Jenkins to analyse the incoming pull requests and compare the result with the main branch? My goal is to reject pull requests which increase the number of static code analysis issues.

Markus Schulte

You can realize your idea by using the Maven-plugins checkstyle, findbugs and pmd (-cpd).

Each of this plugin has a ":check"-mojo, which can fail the build - based on zero or configured rule-violations.

This mojos are bound to the maven-"verify"-phase, so mvn verify will do the job - or you execute the mojos directly within your jenkins-build (job-configuration "Build" -> "Goals and options" -> mvn verfiy, or mvn test checkstyle:check).

The plugins have different ways to configure a fail.

For example, checkstyle-plugin has maxAllowedViolations-configuration-parameter. So you can set this parameter to your current violations-count, and use mvn verfiy or mvn checkstyle:check to let your build fail, if a new violation occurs. Of course, you would have to increase this parameter every time a checkstyle-violation is fixed.

In fingbugs-plugin, your build would have to be free of violations, before you can use mvn findbugs:check.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Create Pull Request on Git Push

分類Dev

git pull と git request-pull の違い

分類Dev

Unchanged files showing in Git pull request

分類Dev

Remove a file from a Git Pull Request

分類Dev

Undo a git merge created by a bitbucket pull request

分類Dev

Is there a way to include old commits in pull request git?

分類Dev

git pull : info/refs HTTP request failed

分類Dev

git request-pull: how to create a (github) pull request on the command line?

分類Dev

check out a "pull request" on Git to review/test a PR

分類Dev

Push changes from git subtree to a branch for a pull request

分類Dev

Can I use pull request on Bonobo Git Server

分類Dev

Merge pull request in git causes the upstream branch to go ahead of origin

分類Dev

Create Pull Request from another Pull Request

分類Dev

Bitbucket Server Pull Request

分類Dev

Jenkins Pull Request Builder

分類Dev

Azure DevOps - Pull Request Git "Next steps: Manually resolve these conflicts and push new changes to the source branch."

分類Dev

List of files changed or updated during the last pull request in git version control

分類Dev

git pull * after * git rebase?

分類Dev

git pull * after * git rebase?

分類Dev

git pull on a different branch

分類Dev

Default behaviour of 'git pull'

分類Dev

MATLAB git Pull

分類Dev

GitHub: terminology: create pull request vs. open pull request

分類Dev

How to modify Github pull request?

分類Dev

Renaming a branch while on pull request

分類Dev

Having a pull request conflict issue

分類Dev

Bitbucket Pull Request Jenkins Job

分類Dev

Jenkinsのpull-requestでgit変更ファイルを取得する方法

分類Dev

Git - What happens to my local master branch after a pull request? How do I manage multiple in progress branches?

Related 関連記事

  1. 1

    Create Pull Request on Git Push

  2. 2

    git pull と git request-pull の違い

  3. 3

    Unchanged files showing in Git pull request

  4. 4

    Remove a file from a Git Pull Request

  5. 5

    Undo a git merge created by a bitbucket pull request

  6. 6

    Is there a way to include old commits in pull request git?

  7. 7

    git pull : info/refs HTTP request failed

  8. 8

    git request-pull: how to create a (github) pull request on the command line?

  9. 9

    check out a "pull request" on Git to review/test a PR

  10. 10

    Push changes from git subtree to a branch for a pull request

  11. 11

    Can I use pull request on Bonobo Git Server

  12. 12

    Merge pull request in git causes the upstream branch to go ahead of origin

  13. 13

    Create Pull Request from another Pull Request

  14. 14

    Bitbucket Server Pull Request

  15. 15

    Jenkins Pull Request Builder

  16. 16

    Azure DevOps - Pull Request Git "Next steps: Manually resolve these conflicts and push new changes to the source branch."

  17. 17

    List of files changed or updated during the last pull request in git version control

  18. 18

    git pull * after * git rebase?

  19. 19

    git pull * after * git rebase?

  20. 20

    git pull on a different branch

  21. 21

    Default behaviour of 'git pull'

  22. 22

    MATLAB git Pull

  23. 23

    GitHub: terminology: create pull request vs. open pull request

  24. 24

    How to modify Github pull request?

  25. 25

    Renaming a branch while on pull request

  26. 26

    Having a pull request conflict issue

  27. 27

    Bitbucket Pull Request Jenkins Job

  28. 28

    Jenkinsのpull-requestでgit変更ファイルを取得する方法

  29. 29

    Git - What happens to my local master branch after a pull request? How do I manage multiple in progress branches?

ホットタグ

アーカイブ