{"id":15733080,"url":"https://github.com/airblade/sinter","last_synced_at":"2025-03-31T03:44:30.339Z","repository":{"id":66514491,"uuid":"55607211","full_name":"airblade/sinter","owner":"airblade","description":"Sinter checks files for syntax errors.","archived":false,"fork":false,"pushed_at":"2022-02-10T17:00:55.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T08:25:31.637Z","etag":null,"topics":["shell","syntax-checker"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/airblade.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-04-06T13:13:51.000Z","updated_at":"2022-02-08T14:07:06.000Z","dependencies_parsed_at":"2023-05-01T23:33:16.453Z","dependency_job_id":null,"html_url":"https://github.com/airblade/sinter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airblade%2Fsinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airblade%2Fsinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airblade%2Fsinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airblade%2Fsinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/airblade","download_url":"https://codeload.github.com/airblade/sinter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413229,"owners_count":20773053,"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":["shell","syntax-checker"],"created_at":"2024-10-04T00:40:55.251Z","updated_at":"2025-03-31T03:44:30.321Z","avatar_url":"https://github.com/airblade.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sinter\n\nSinter checks files for syntax errors.  You can call it directly (on the command line, inside Vim, etc) or from a git pre-commit hook.  It is not a style checker.\n\nThere are zillions of syntax-checking pre-commit hooks already.  However all the ones I saw require modifying the hook whenever you modify your syntax checks.  This is annoying to do even once, let alone when you have many repos.\n\nWith Sinter you never need to modify your hooks (after the initial installation), nor even `sinter` itself.  To extend your syntax checks with a new filetype, just drop in a new linter.  Sinter will automatically find it.\n\n\n## Features\n\n- Call directly or from pre-commit hook.\n- Your pre-commit hook never changes once installed.\n- The pre-commit hook lists all files with syntax errors, not just the first.\n- Trivial to extend with new file types.\n\n\n## Installation\n\nClone the `sinter` repo.\n\nPut the `sinter` script somewhere on your path.  I symlink it into my `~/bin` directory which is on my path:\n\n    ln -nfs /path/to/sinter/repo/sinter ~/bin/\n\nCopy or symlink the `pre-commit` script into your repo's `/git/hooks` directory, or install as a git template.  If you already have a pre-commit hook, you'll find it easy to combine the two manually.\n\nThe linters have these dependencies:\n\nLinter | Dependency |\n-------|------------|\nbash | bash |\ncss | [csslint](https://github.com/CSSLint/csslint) |\nhaml | haml |\njavascript | [eslint](https://eslint.org) |\nruby | ruby |\nsass | [sass](https://github.com/sass/dart-sass) |\nslim | slimrb |\nvimscript | [vint](https://github.com/Kuniwak/vint) |\nyaml | ruby |\n\n\n## Usage\n\nTo check a file:\n\n    sinter [-q] FILE\n\nIf `FILE` is syntactically correct sinter will output `syntax ok`.  The exit code is 0.\n\nIf `FILE` has syntax errors sinter will output `syntax error` on stdout and the errors on stderr.  The exit code is 1.\n\nIf sinter doesn't know how to check `FILE` it will output `no linter for FILE`.  The exit code is 2.\n\nThe `-q` flag suppresses output.\n\nTo list the linters:\n\n    sinter --linters\n\nTo skip the pre-commit hook when committing:\n\n    git commit --no-verify\n    git commit -n\n\nTo check existing code:\n\n    git ls-files -z                         |\n    xargs -0 file --mime                    |  # only process text files\n    awk -F\":[ ]*\" '$2 ~ /^text/ {print $1}' |  # ditto\n    xargs -n1 sinter\n\nInside Vim:\n\n    nnoremap \u003cleader\u003es :!sinter %\u003cCR\u003e\n\n\n## Linters\n\nLinters reside in the `linters/` directory.\n\nTo add a new linter write a script that:\n\n- is named for the file type it checks;\n- implements `is_foo()`:\n  - it receives the filename, extension, and shebang as arguments\n  - it must exit with success or failure;\n- implements `lint_foo()`:\n  - it receives the full file path as an argument;\n  - it should write any syntax errors to stderr;\n  - it must exit with success or failure.\n\nYou do not need to update `sinter` or your pre-commit hooks.\n\nTo remove a linter, just delete it.  You do not need to update `sinter` or your pre-commit hooks.\n\n\n## Credits\n\n[ochtra](https://github.com/kvz/ochtra) was the best commit hook I found, but I wanted something which could be run standalone and didn't require updating the hook itself whenever I extended the syntax checks.\n\n\n## Intellectual property\n\nCopyright Andrew Stewart, AirBlade Software.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairblade%2Fsinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fairblade%2Fsinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairblade%2Fsinter/lists"}