Code Monkey home page Code Monkey logo

sonar-yaml's Introduction

YAML SonarQube Plugin

Apache License, Version 2.0, January 2004 Maven Central Build Status Sonarcloud Status Sonarcloud Status

SonarQube plugin to analyze YAML code based on yamllint.

Rules

The plugin comes with a default "Sonar way" profile with most common rules enabled:

  • Syntax error check
  • Braces check
  • Brackets check
  • Colons check
  • Commas check
  • Comments check
  • Comments indentation check
  • Document start check
  • Empty lines check
  • Empty values check
  • Hyphens check
  • Indentation check
  • Key duplicates check
  • Line length check
  • New line at end of file check
  • New lines check
  • Octal values check
  • Trailing spaces check
  • Truthy check

Some additional rules are provided but not enabled by default:

  • Document end check
  • Forbidden key check
  • Forbidden value check (new in 1.3.0)
  • Key ordering check
  • Quoted strings check (new in 1.4.0)
  • Required key check (new in 1.5.0)

Once installed, you may go to the profile management screens to create your own profile and add or remove rules, change levels, and parameters, etc.

Installation

Plugin for SonarQube 6.6+ (tested on 6.7 LTS), 7.0+ (tested on 7.7, 7.8 and 7.9 LTS), 8.0+ (tested on 8.0).

Just download the plugin JAR file and copy it to the extensions/plugins directory of SonarQube and restart.

Troubleshooting/known issues

Scan fail with "ERROR: Caused by: x is not a valid line offset for pointer. File xyz.yml has y character(s) at line z"

This may be due to issue #6: if your YAML file contains YAML-valid UTF-8 line break characters such as U+2028, SonarQube may just strip them, causing the character and lines references being different between the YAML parser and SonarQube.

If such an error is met, go to the main or project general settings of the YAML plugin and enable the option "Filter UTF-8 Line Breaks". This will make the plugin to ignore some valid UTF-8 line break characters (U+2028, U+2029 and U+0085) so that SonarQube and the plugin both use the same character and line indices and the scan should complete.

sonar-yaml's People

Contributors

sbaudoin avatar milbrandt avatar axel3rd avatar andmagom avatar dependabot[bot] avatar

Watchers

James Cloos avatar  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.