GithubHelp home page GithubHelp logo

devdevdany / sonar-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sonarsource/sonar-python

0.0 0.0 0.0 15.08 MB

:snake: SonarQube Python plugin

Home Page: https://docs.sonarqube.org/display/PLUG/SonarPython

License: GNU Lesser General Public License v3.0

Shell 0.01% Python 40.17% Java 54.01% Makefile 0.01% HTML 5.80% Dockerfile 0.01% Starlark 0.01%

sonar-python's Introduction

Code Quality and Security for Python Build Status Quality Gate

Python analyzer for SonarQube, SonarCloud and SonarLint

Useful links

Building the project

Fast/minimal build

Prerequisites:

  • JDK 11
  • Maven 3.0.0 or newer

The easiest way to build the Project is by running:

mvn clean install -DskipTypeshed

It builds only Java Maven modules, run tests, and install jar locally. The Python interpreter is not required in that case.

Full build

Prerequisites:

  • JDK 11
  • Maven 3.0.0 or newer
  • Python 3.9 or newer
  • tox - pip install tox
  • Run git submodule update --init to retrieve Typeshed as a Git submodule

All above should be available in PATH.

To execute full build just run:

mvn clean install

The full build executes Typeshed serializer script. It generates protobuf messages for Typeshed symbols (for standard Python API) and our customs symbols (for Python libraries, e.g. AWS CDK). This helps in type inference and providing better rules.

How to contribute

Configuration

First, please configure your IDE: https://github.com/SonarSource/sonar-developer-toolset.

Rule annotation

Each new implemented rule should have @Rule(key = "S0000") annotation on the class level. The number of the rule can be found here: https://sonarsource.github.io/rspec/#/rspec/?lang=python. The key is usually automatically generated by a rspec repository GitHub action and needs to be unique in the whole project.

Expectations:

  • Commit message should be prefixed with the ticket number.
  • Working on separate branch and creating PR when it's finished.
  • Clean coded, well tested solution, quality gate should pass.
  • Fix all issues reported by SonarQube Next instance.
  • 95% or more code coverage for new changes (if possible). It can be checked on CI build.

Before push

Please check if all files have a license header. If not, the mvn install will fail with Some files do not have the expected license header message. To fix that please execute: mvn license:format.

License

Copyright 2011-2022 SonarSource.

Licensed under the GNU Lesser General Public License, Version 3.0

sonar-python's People

Contributors

alban-auzeill avatar andrea-guarino-sonarsource avatar andreaguarino avatar andrey-tyukin-sonarsource avatar benzonico avatar christophe-zurn-sonarsource avatar dgageot avatar dmitry-golovinov-sonarsource avatar drautureau-sonarsource avatar ehartmann avatar fmallet avatar godin avatar guillaume-dequenne-sonarsource avatar gyula-sallai-sonarsource avatar ivandalbosco avatar julienlancelot avatar karim-ouerghemmi-sonarsource avatar lindamartin avatar marco-bearzi-sonarsource avatar mpaladin avatar mstachniuk avatar nils-werner-sonarsource avatar pynicolas avatar rudy-regazzoni-sonarsource avatar saberduck avatar sallaigy avatar tomverin avatar vilchik-elena avatar wenns avatar wohops 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.