Git Product home page Git Product logo

codeclimate-ss-analyzer-wrapper's Introduction

Code Climate Wrapper for SonarSource Analyzers

CircleCI Maintainability Test Coverage

codeclimate-ss-analyzer-wrapper is the base library for SonarSource based engines. It wraps Sonarlint in standalone mode.

Tests

make test

Usage

You can use the codeclimate-sonar-php repo as an example for building a new sonar based engine. The important aspects are listed below:

  1. Use this wrapper lib. Make sure your build.gradle has the following entries:
repositories {
  jcenter()
  maven { url 'https://jitpack.io' }
}

dependencies {
  compile("com.github.codeclimate:sonar-wrapper:master-SNAPSHOT")
}
  1. Add the plugin lib and make sure it is copied to the build/plugins directory as part of the build task:
task copyPlugins(type: Copy) {
  into "${buildDir}/plugins"
  from configurations.testCompile
  include "sonar-*-plugin*.jar"
}

build.dependsOn(copyPlugins)

dependencies {
  // ...
  compile("org.sonarsource.php:sonar-php-plugin:2.10.0.2087")
}
  1. Running: The wrapper overrides a few classes from the sonar libraries which makes classpath order something very important to pay attention: bin/codeclimate-sonar:
#!/usr/bin/env sh

BUILD_DIR=$(dirname $0)
APP=$(find ${BUILD_DIR}/libs -name "codeclimate-sonar-php.jar" | head -n1)
WRAPPER=$(find ${BUILD_DIR}/libs -name "sonar-wrapper*.jar" | head -n1)
CORE=$(find ${BUILD_DIR}/libs -name "sonarlint-core*.jar" -or -name "sonarlint-client-api*.jar" | tr "\n" ":")
LIBS=$(find ${BUILD_DIR}/libs -name "*.jar" | tr "\n" ":")

CODE_DIR=$1; shift
CONFIG_FILE=$1; shift

java \
  -noverify \
  -cp ${APP}:${WRAPPER}:${CORE}:${LIBS} \
  -Djava.awt.headless=true  \
  -Dsonarlint.home="${BUILD_DIR}"  \
  -Dproject.home="${CODE_DIR}"  \
  -Dconfig="${CONFIG_FILE}"  \
  -Dorg.freemarker.loggerLibrary=none  \
  cc.App $@

bin/codeclimate-sonar /code /config.json

Sonar Documentation

http://www.sonarlint.org/commandline

http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner

Issue Tracker: http://jira.sonarsource.com/browse/SLCLI

Copyright

This repository is maintained by CodeClimate. It uses SonarLint, which is a SonarSource product. This is not endorsed by SonarSource.

See LICENSE

codeclimate-ss-analyzer-wrapper's People

Contributors

fede-moya avatar filipesperandio 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.