GithubHelp home page GithubHelp logo

irfanahmadin / sonar-ruby-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fortitudetec/sonar-ruby-plugin

0.0 1.0 0.0 63 KB

SonarQube plugin for analyzing Ruby files

License: MIT License

Dockerfile 0.14% Java 98.92% Ruby 0.94%

sonar-ruby-plugin's Introduction

Sonar Ruby Plugin

SonarQube plugin for analyzing Ruby files

SonarCloud

Requirements

Overview

This is plugin for SonarQube 5.6+ for analysing projects with Ruby content that supports:

  • Rubocop for code quality information
  • Simplecov for unit test coverage information
  • NCLOC metric generation

Configuration

Example project configuration

This is an example of what a project configuration file (sonar-project.properties) could look like:

sonar.projectKey=company:my-application
sonar.projectName=My Application
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
sonar.sources=src/app
sonar.exclusions=**/node_modules/**,**/*.spec.ts
sonar.tests=src/app
sonar.test.inclusions=**/*.spec.ts

sonar.ruby.file.suffixes=rb,ruby
sonar.ruby.coverage.reportPath=coverage/.resultset.json
sonar.ruby.coverage.framework=RSpec
sonar.ruby.rubocopConfig=.rubocop.yml
sonar.ruby.rubocop=/usr/bin/rubocop
sonar.ruby.rubocop.reportPath=rubocop-result.json
sonar.ruby.rubocop.filePath=.

Installation

Manual Installation

Here are the steps to manually install this plugin for use in SonarQube:

  1. Download the plugin jar
  2. Copy the jar into the SonarQube plugin directory (e.g. /opt/sonarqube/extensions/plugins)
  3. Restart SonarQube

Update Center Installation

TODO: Need to get this plugin added to SonarQube's update center

Running the analysis

In order to run the analysis for Ruby you will need to utilize the sonar-scanner application.

  • Run rubocop making sure that the json results file is created
    e.g. rubocop --format=json --out=rubocop-result.json

  • Run your specs (make sure that your sonarqube config points to the right coverage directory )
    e.g. bundle exec rspec spec
    Make sure that your sonarqube config points to the right coverage directory e.g. spec/coverage/.resultset.json

  • Make sure you have a sonar-project.properties file in the root of your project directory

  • run sonar-scanner

sonar-ruby-plugin's People

Contributors

chrisrohr avatar lotrgollum avatar vassilevsky avatar

Watchers

Irfan Ahmad 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.