{"id":28409785,"url":"https://github.com/realseroman/linebolt","last_synced_at":"2025-07-25T22:13:44.923Z","repository":{"id":295325963,"uuid":"989752570","full_name":"RealSeroMan/linebolt","owner":"RealSeroMan","description":"Ultra-fast C tool that counts lines in .c/.h files. Skips .git, build/, handles edge cases (e.g. missing newline). Non-recursive, POSIX-only.","archived":false,"fork":false,"pushed_at":"2025-05-25T00:12:22.000Z","size":1806,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-02T20:38:57.096Z","etag":null,"topics":["c","cli","cloc-alternative","fast","line-counter","linux-tools","performance","posix","source-code-analysis"],"latest_commit_sha":null,"homepage":"","language":"C","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/RealSeroMan.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,"zenodo":null}},"created_at":"2025-05-24T18:51:20.000Z","updated_at":"2025-05-25T00:16:09.000Z","dependencies_parsed_at":"2025-05-24T23:34:44.600Z","dependency_job_id":"bf977418-3372-4194-bb48-a4a601f01978","html_url":"https://github.com/RealSeroMan/linebolt","commit_stats":null,"previous_names":["realseroman/line_counter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RealSeroMan/linebolt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealSeroMan%2Flinebolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealSeroMan%2Flinebolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealSeroMan%2Flinebolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealSeroMan%2Flinebolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RealSeroMan","download_url":"https://codeload.github.com/RealSeroMan/linebolt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealSeroMan%2Flinebolt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263388710,"owners_count":23459255,"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":["c","cli","cloc-alternative","fast","line-counter","linux-tools","performance","posix","source-code-analysis"],"created_at":"2025-06-02T10:41:56.710Z","updated_at":"2025-07-03T19:33:16.843Z","avatar_url":"https://github.com/RealSeroMan.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"linebolt.png\" alt=\"linebolt logo\" width=\"200\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cb\u003eThe lightning-fast line counter for source projects.\u003c/b\u003e\u003c/p\u003e\n\n# linebolt — Blazing-Fast Line Counter for Source Projects\n\n**linebolt** is a lightweight, high-performance command-line tool written in C that traverses directories and counts the total number of lines in source code files — fast. Originally designed for `.c` and `.h` files, it's engineered to scale to massive codebases like the Linux kernel, and flexible enough to support any extension (`.py`, `.cpp`, `.yaml`, etc.).\n\n* 10× faster than `cloc` on large codebases  \n* Handles massive trees like the Linux kernel in under 10 seconds  \n* Accurate even for files without a trailing newline  \n* POSIX-compatible (Linux, macOS)\n\n---\n\n## Features\n* Counts lines in all `.c` and `.h` files by default\n* Non-recursive traversal using an internal stack (no malloc, no crashes)\n* Skips irrelevant directories (`.git`, `build`, `bin`, etc.)\n* Correctly counts files without final newline (unlike `wc -l`)\n* Ignores empty files (zero-character files)\n* Designed for Linux and other POSIX systems\n* Ultra fast — C standard library only\n\nFuture roadmap:\n* [ ] Custom extension filtering (`--ext py,cpp`)\n* [ ] Blank/comment line exclusion\n* [ ] JSON or CSV output mode\n* [ ] Per-directory summaries\n\n## Build Instructions\nYou need a POSIX-compatible system (Linux, macOS) and GCC or Clang installed.\n\n### Compile\n```bash\ngcc -Wall -Wextra -o linebolt linebolt.c\n```\n\n### Run\nTo count all `.c` and `.h` lines in the current directory:\n\n```bash\n./linebolt\n```\n\nOutput includes line counts per file and a total at the end.\n\n### Example Output\n```   23 lines  ./src/main.c\n   12 lines  ./include/util.h\n    9 lines  ./src/helpers.c\n\n=============================\nTotal lines: 44 \n```\n## Behavior Differences Compared to `cloc`\n\nUnlike `cloc`, **linebolt counts all matching files** — even if their contents are byte-for-byte identical.\n\nThis ensures line counts reflect **what actually exists in the repository**, rather than deduplicating identical files. As a result, `linebolt` may report **slightly higher totals** on projects that contain copied or duplicated files (e.g., vendored libraries, backups, or symlinks).\n\n\u003e In testing on the Linux kernel, `linebolt` reported about **1% more lines** than `cloc`, due to this intentional difference.\n\n\n\n## Directory Filtering\nBy default, `linebolt` skips common non-source folders:\n* `.git`\n* `.svn`\n* `bin`\n* `build`\n* `obj`  \n\nYou can customize this in `should_ignore_dir()` in the source code.\n\n## License\nMIT License (see [LICENSE](LICENSE))\n\nAuthor: [Zülfü Serhat Kük](https://github.com/RealSeroMan)  \nYear: 2025\n\n## Contributions\nWant to extend it to support other languages or formats? Want blazing-fast CSV or JSON output? Open a pull request or submit an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealseroman%2Flinebolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealseroman%2Flinebolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealseroman%2Flinebolt/lists"}