The Wayback Machine - https://web.archive.org/web/20220421031117/https://github.com/duolingo/splinter
Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

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

About

Simple pattern-based linter 🐀

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages