{"id":20954569,"url":"https://github.com/duolingo/splinter","last_synced_at":"2025-05-14T04:32:51.806Z","repository":{"id":54226549,"uuid":"116344566","full_name":"duolingo/splinter","owner":"duolingo","description":"Simple pattern-based linter :rat:","archived":false,"fork":false,"pushed_at":"2024-06-17T05:52:00.000Z","size":18,"stargazers_count":41,"open_issues_count":2,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-17T06:52:45.841Z","etag":null,"topics":["bash","grep","linter","regex","unix"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duolingo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-05T05:09:10.000Z","updated_at":"2024-06-17T05:52:01.000Z","dependencies_parsed_at":"2022-08-13T09:40:21.670Z","dependency_job_id":"8cb54c2b-1bf9-4ca5-aac0-040ff480b26c","html_url":"https://github.com/duolingo/splinter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fsplinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fsplinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fsplinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fsplinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duolingo","download_url":"https://codeload.github.com/duolingo/splinter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225275636,"owners_count":17448389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","grep","linter","regex","unix"],"created_at":"2024-11-19T01:15:13.394Z","updated_at":"2024-11-19T01:15:14.001Z","avatar_url":"https://github.com/duolingo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Splinter\n\nHere's a dead simple,\n\u003cbr\u003e\npattern-based linter for code\n\u003cbr\u003e\nin any language.\n\nIt's not that smart, but\n\u003cbr\u003e\nit needs only Bash and runs\n\u003cbr\u003e\non any Unix.\n\nDefine your rules in\n\u003cbr\u003e\na text file as a list of\n\u003cbr\u003e\nmessage/regex pairs.\n\n## Usage\n\n1. Copy-paste `splinter` into your project and make it executable:\n\n   ```bash\n   chmod +x splinter\n   ```\n\n1. Create a rule file named something like `rules.txt`:\n\n   ```text\n   # This is a comment and will be ignored.\n   # Each rule is defined as an error message followed\n   # by the regex (POSIX ERE) that should trigger it.\n\n   Remove trailing whitespace\n   \\s$\n\n   Use `assert.strictEqual()` instead of `assert.equal()`\n   assert\\.equal\n   ```\n\n1. Run Splinter:\n\n   ```bash\n   # The rule file is the only required argument. Optionally, provide\n   # a list of files/directories to lint (default: current directory)\n   ./splinter rules.txt index.js src\n   ```\n\n1. See the output! The exit code will be 1 if violations are found - useful for CI.\n\n   ```text\n   index.js:25:Remove trailing whitespace\n   index.js:26:Remove trailing whitespace\n   src/foobar.test.js:130:Use `assert.strictEqual()` instead of `assert.equal()`\n   ```\n\nSplinter will ignore violations on any line of code that contains `splinter:ignore` in a comment.\n\n### Running with pre-commit\n\nYou can also set up this repo as a [pre-commit hook](https://pre-commit.com/). For example:\n\n```yaml\n- repo: https://github.com/duolingo/splinter.git\n  rev: 1.4.0\n  hooks:\n    - id: splinter\n      args:\n        - config/splinter-rules-py.txt\n      files: \\.py$\n```\n\n_Duolingo is hiring! Apply at https://www.duolingo.com/careers_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduolingo%2Fsplinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduolingo%2Fsplinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduolingo%2Fsplinter/lists"}