All Projects → QuickenLoans → ramllint

QuickenLoans / ramllint

Licence: MIT license
RAML Linter

Programming Languages

javascript
184084 projects - #8 most used programming language
RAML
58 projects
shell
77523 projects

Projects that are alternatives of or similar to ramllint

lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-22.22%)
Mutual labels:  linter, static-analysis
dlint
Dlint is a tool for encouraging best coding practices and helping ensure Python code is secure.
Stars: ✭ 130 (+622.22%)
Mutual labels:  linter, static-analysis
Cflint
Static code analysis for CFML (a linter)
Stars: ✭ 156 (+766.67%)
Mutual labels:  linter, static-analysis
Abaplint
Standalone linter for ABAP
Stars: ✭ 111 (+516.67%)
Mutual labels:  linter, static-analysis
Protoc Gen Lint
A plug-in for Google's Protocol Buffers (protobufs) compiler to lint .proto files for style violations.
Stars: ✭ 221 (+1127.78%)
Mutual labels:  linter, static-analysis
Njsscan
njsscan is a semantic aware SAST tool that can find insecure code patterns in your Node.js applications.
Stars: ✭ 128 (+611.11%)
Mutual labels:  linter, static-analysis
Woke
✊ Detect non-inclusive language in your source code.
Stars: ✭ 190 (+955.56%)
Mutual labels:  linter, static-analysis
Flake8
The official GitHub mirror of https://gitlab.com/pycqa/flake8
Stars: ✭ 1,112 (+6077.78%)
Mutual labels:  linter, static-analysis
Spotbugs
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.
Stars: ✭ 2,569 (+14172.22%)
Mutual labels:  linter, static-analysis
Bellybutton
Custom Python linting through AST expressions
Stars: ✭ 196 (+988.89%)
Mutual labels:  linter, static-analysis
Gopherci
GopherCI was a project to help you maintain high-quality Go projects, by checking each GitHub Pull Request, for backward incompatible changes, and a suite of other third party static analysis tools.
Stars: ✭ 105 (+483.33%)
Mutual labels:  linter, static-analysis
Revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
Stars: ✭ 3,139 (+17338.89%)
Mutual labels:  linter, static-analysis
Unimport
A linter, formatter for finding and removing unused import statements.
Stars: ✭ 96 (+433.33%)
Mutual labels:  linter, static-analysis
Rstcheck
Checks syntax of reStructuredText and code blocks nested within it
Stars: ✭ 130 (+622.22%)
Mutual labels:  linter, static-analysis
Static Analysis
⚙️ A curated list of static analysis (SAST) tools for all programming languages, config files, build tools, and more.
Stars: ✭ 9,310 (+51622.22%)
Mutual labels:  linter, static-analysis
Bodyclose
Analyzer: checks whether HTTP response body is closed and a re-use of TCP connection is not blocked.
Stars: ✭ 181 (+905.56%)
Mutual labels:  linter, static-analysis
Sonar Jproperties Plugin
SonarQube Java Properties Analyzer
Stars: ✭ 5 (-72.22%)
Mutual labels:  linter, static-analysis
Clj Kondo
A linter for Clojure code that sparks joy.
Stars: ✭ 1,083 (+5916.67%)
Mutual labels:  linter, static-analysis
Diktat
Strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs
Stars: ✭ 196 (+988.89%)
Mutual labels:  linter, static-analysis
D Scanner
Swiss-army knife for D source code
Stars: ✭ 221 (+1127.78%)
Mutual labels:  linter, static-analysis

Build Status Coverage Status Codacy Badge Code Climate Dependency Status License Type Join the chat at https://gitter.im/QuickenLoans/ramllint

NPM

RAML is a language for modeling RESTful APIs. By design, it does not enforce any style rules on how to consistently document APIs, because not all projects will require the same level of rule enforcement. However, it can often be useful to enforce uniform rules and standards across a group of related APIs to ensure consistency and uniformity across multiple teams or business units.

RAML Linter is a static analysis, linter-like, utility that will enforce rules on a given RAML document, ensuring consistency and quality.

Installing

npm install -g ramllint

Using the Linter

RAML Linter can be used either as a library or as a command line utility.

Library

Using the library in code provides the most flexibility, offering error handling and the ability to parse the full results for: error, warning, and info log entries.

var Linter = require('ramllint'),

    ramllint = new Linter();

ramllint.lint('./path/to/api.raml', function (results) {
   // NOTE: results will only contain 'error' and will exclude 'warning' and 'info'
   // to get an array of all log entries use: `ramllint.results()`

  if (!results.length) {
    // no errors, all rules are satisfied
  } else {
    // errors
  }
});

Rules

The default rules are included in the src/defaults.json file. You can make adjustments to the test used in the rule by passing options to the Linter constructor.

For example, if you'd like to change the rules for URL validation to permit /sticky-wickets and /{stickyWicketId}, you can do this:

var Linter = require('ramllint'),
    options = {
        'url_lower': '^\\/([a-z]+(-[a-z]+)*|{[a-z]+([A-Z][a-z]+)*})$'
    },
    ramllint = new Linter(options);

Options need to be a JSON object with keys that match an id from the defaults.json file and values that are strings or string RegExp patterns.

Command Line

If you are in the same directory as your RAML document:

ramllint

If your RAML document is in another directory:

ramllint path/to/api.raml

Note: specifying the file (second example above) might be necessary for some OSes.

(npm) Scripts

Below is a list of commands available via npm run for you convenience:

  • npm run cover for TravisCI only
  • npm run doc
    1. Remove the docs/ directory to start clean
    2. Generate documentation pages (JSDoc) in docs/
    3. Create code coverage report (Istanbul) docs/coverage/lcov-report/
    4. Create code statistics report (Plato) docs/coverage/
  • npm run doc:pub for publishing docs/ to gh-pages
  • npm run lint - static code analysis and code style linting
    1. JShint
    2. ESlint
  • npm run quality - runs lint and code coverage
  • npm test - runs unit tests (Mocha)
  • npm run watch - watches test/ and src/ for changes and re-runs tests

Documentation

  1. Code Documentation
  2. Code Coverage Report
  3. Static Code Analysis

Contributing

  1. Fork this repository
  2. git clone
  3. npm install
  4. Create a working branch
  5. Write code and tests
  6. Submit Pull Request

This project aims to maintain a high level of unit test code coverage. All pull requests must be accompanied by appropriate test cases, and all tests must pass in order to be considered for merge.

For detailed rules on contributions, please refer to our contribution guidelines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].