{"id":17383866,"url":"https://github.com/mcandre/sail","last_synced_at":"2025-04-15T10:09:45.508Z","repository":{"id":66387117,"uuid":"312878695","full_name":"mcandre/sail","owner":"mcandre","description":"Identify C/C++ source code files","archived":false,"fork":false,"pushed_at":"2025-04-01T00:06:00.000Z","size":1570,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T10:09:26.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcandre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-11-14T18:37:04.000Z","updated_at":"2025-04-01T00:06:04.000Z","dependencies_parsed_at":"2024-08-06T09:53:34.347Z","dependency_job_id":"c7a6bb50-0b0c-4924-9052-9221efc576ef","html_url":"https://github.com/mcandre/sail","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcandre%2Fsail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcandre%2Fsail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcandre%2Fsail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcandre%2Fsail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcandre","download_url":"https://codeload.github.com/mcandre/sail/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048738,"owners_count":21204306,"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":[],"created_at":"2024-10-16T07:44:02.316Z","updated_at":"2025-04-15T10:09:45.503Z","avatar_url":"https://github.com/mcandre.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sail: Identify C/C++ source code files\n\n```text\n     _~\n  _~ )_)_~\n  )_))_))_)\n  _!__!__!_\n  \\______t/\n~~~~~~~~~~~~~\n```\n\n# ABOUT\n\nsail navigates the roiling seas of source code files, catching C/C++ headers and implementations for downstream processing. This is primarily of interest when linting large projects, when a static analyzer lacks built-in support for recursive file lookup.\n\n# EXAMPLES\n\n```console\n$ sail examples\nexamples/cmd/hello/hello.c\nexamples/cmd/hello/hello.cpp\nexamples/square.cppm\nexamples/lib/fizzy.h\n\n$ sail -print0 examples | xargs -0 -n 1 wc -l\n       7 examples/cmd/hello/hello.c\n       6 examples/cmd/hello/hello.cpp\n       3 examples/square.cppm\n       8 examples/lib/fizzy.h\n```\n\nsail can also restrict results to just C files, or just C++ files. This helps when working with linters that may only be relevant for one programming language or the other.\n\nSee `sail -help` for more detail.\n\n# LICENSE\n\nBSD-2-Clause\n\n# RUNTIME REQUIREMENTS\n\n* [GNU](https://www.gnu.org/)/[BSD](https://en.wikipedia.org/wiki/Berkeley_Software_Distribution) [findutils](https://en.wikipedia.org/wiki/Find_(Unix))\n* [POSIX](https://pubs.opengroup.org/onlinepubs/9799919799/) compatible [sh](https://en.wikipedia.org/wiki/Unix_shell)\n\n## Recommended\n\n* [clang-format](https://clang.llvm.org/docs/ClangFormat.html)\n* [clang-tidy](https://clang.llvm.org/extra/clang-tidy/)\n* [cmake](https://cmake.org/)\n* [cppcheck](http://cppcheck.sourceforge.net/)\n* [cpplint](https://github.com/cpplint/cpplint)\n* [zsh](https://www.zsh.org/)\n\n# INSTALL\n\nFor more information on installing or uninstalling sail, see [INSTALL.md](INSTALL.md).\n\n# NOTES\n\nsail examines the file extension to assess programming language; no effort is put into analyzing the contents for C/C++ grammar or syntactic validity.\n\nOnly modern, lowercase file extensions are reported by sail:\n\n* C: `.h` (headers), `.c` (implementations)\n* C++: `.hpp` (headers), `.cpp` (implementations), `.cppm` (modules)\n\nIf sail doesn't find your C/C++ file, then it may not strictly a C/C++ file (such as an Arduino programming language extension). More likely, the file is simply using a vintage file extension, which can play havoc with syntax highlighting and linting.\n\nOnly plain C, C++ source code files are reported by sail. The following related formats are ignored:\n\n* C#: `.cs`\n* CUDA: `.cu`\n* Single Assignment C: `.sac`\n* Objective C++: `.mhh`, `.mm`\n* D: `.d`\n\nHowever, some historical conventions for unusual C/C++ header extensions may be supported, see the patterns listed in [bin/sail](https://github.com/mcandre/sail/blob/master/bin/sail).\n\n(sp)lint has not been sufficiently maintained as of this writing to parse C89/99 or later syntax. Any application written in C is generally advised to use a more modern linter.\n\nFortunately, C++ linters such as those listed above are able to handle both C and C++ code.\n\nUnfortunately, file extensions are overloaded with conflicting meanings. For example, `*.h` can refer to a C header, or a C++ header, or an Objective C header. And `.m` can refer to an Objective C implementation or a MATLAB / Octave implementation. Sending the wrong file to the wrong linter will produce incorrect results. Likewise, your text editor will often get confused.\n\nYou can distinguish between these differing syntaxes by naming your headers with modern, convential file extensions.\n\n* Objective C / Objective C++: `.mhh`\n\nand your implementations:\n\n* Objective C / Objective C++: `.mm`\n* MATLAB / Octave: `.m`\n\nYet more fringe file extensions exist. For example, `.ino` files (Arduino extensions to C++), and `.inc` files (legacy headers used by a variety of different programming languages). These files may not process reliably when submitted to automated linters.\n\nAvoid using spaces in files or folders, as this generally presents difficulties for build systems.\n\n# CONTRIBUTING\n\nFor more details on developing sail itself, see [DEVELOPMENT.md](DEVELOPMENT.md).\n\n# SEE ALSO\n\n* [kirill](https://github.com/mcandre/kirill), a JSON file finder\n* [rez](https://github.com/mcandre/rez), a C/C++ task runner\n* [stank](https://github.com/mcandre/stank), a collection of POSIX-y shell linters\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcandre%2Fsail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcandre%2Fsail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcandre%2Fsail/lists"}