Giter Site home page Giter Site logo

sonar-py's Introduction

sonar-py

This tool allows you to automate tasks with SonarQube or add it to your pipeline. It will connect with SonarQube API and use local sonar-client app for scanning selected folder.

For connecting with SonarQube tool uses shijl0925/python-sonarqube-api.

How it works

Script logic is:

  1. get existing project or create new if not found
  2. Generate configuration file if needed
  3. Run local program (sonar-scaner) for starting analyzing
  4. Get founded issues from API
  5. Print or save founded data
  6. Delete project if needed

Usage

usage: sonar.py [-h] [-u URL] [-l LOGIN] [-p PASSWORD] [-t TOKEN] [-n PROJECT]
                [-s SCAN] [-o OUTPUT] [-j] [-d]

SonarQube API adapter

optional arguments:
  -h, --help            show this help message and exit
  -u URL, --url URL     SonarQube link. Default is http://localhost:9000
  -l LOGIN, --login LOGIN
                        SonarQube login
  -p PASSWORD, --password PASSWORD
                        SonarQube password
  -t TOKEN, --token TOKEN
                        SonarQube token
  -n PROJECT, --project PROJECT
                        Target SonarQube project. If not selected - tool will generate new.
  -s SCAN, --scan SCAN  Scan folder for analyzing. Default is this script
                        folder
  -o OUTPUT, --output OUTPUT
                        Output file for data
  -j, --json            Data as json
  -d, --delete          Remove project in the end
  -r, --remove_old      Remove other generated projects before run
  -dt DELETE_TIME, --delete-time DELETE_TIME
                        Days that other generated project will be kept.
                        Default 30

sonar-py's People

Contributors

zeinlol avatar

Watchers

 avatar

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.