Splinter
Simple pattern-based linter :rat:
Install / Use
/learn @duolingo/SplinterREADME
Splinter
Here's a dead simple, <br> pattern-based linter for code <br> in any language.
It's not that smart, but <br> it needs only Bash and runs <br> on any Unix.
Define your rules in <br> a text file as a list of <br> message/regex pairs.
Usage
-
Copy-paste
splinterinto your project and make it executable:chmod +x splinter -
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 -
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 -
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()`
Splinter will ignore violations on any line of code that contains splinter:ignore in a comment.
Running with pre-commit
You can also set up this repo as a pre-commit hook. For example:
- repo: https://github.com/duolingo/splinter.git
rev: 1.4.0
hooks:
- id: splinter
args:
- config/splinter-rules-py.txt
files: \.py$
Duolingo is hiring! Apply at https://www.duolingo.com/careers
Related Skills
node-connect
353.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
