GithubHelp home page GithubHelp logo

splinter's Introduction

Splinter

Here's a dead simple,
pattern-based linter for code
in any language.

It's not that smart, but
it needs only Bash and runs
on any Unix.

Define your rules in
a file as a list of
message/regex pairs.

Usage

  1. Copy-paste splinter into your project and make it executable:

    chmod +x splinter
  2. Create a rule file named something like rules.txt:

    # This is a comment and will be ignored.
    # Each rule is defined as an error message followed
    # by the regex (POSIX ERE) that should trigger it.
    
    Remove trailing whitespace
    \s$
    
    Use `assert.strictEqual()` instead of `assert.equal()`
    assert\.equal
    
  3. Run Splinter:

    # The rule file is the only required argument. Optionally, provide
    # a list of files/directories to lint (default: current directory)
    ./splinter rules.txt index.js src
  4. See the output! The exit code will be 1 if violations are found - useful for CI.

    index.js:25:Remove trailing whitespace
    index.js:26:Remove trailing whitespace
    src/foobar.test.js:130:Use `assert.strictEqual()` instead of `assert.equal()`
    

Duolingo is hiring! Apply at https://www.duolingo.com/careers

splinter's People

Contributors

artnc avatar

Stargazers

 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.