{"id":19401251,"url":"https://github.com/mishamyrt/compars","last_synced_at":"2025-09-06T02:46:51.563Z","repository":{"id":108578155,"uuid":"345805089","full_name":"mishamyrt/compars","owner":"mishamyrt","description":"📄 Fast comment parser","archived":false,"fork":false,"pushed_at":"2021-10-18T13:48:43.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-17T05:37:24.957Z","etag":null,"topics":["comments","golang","parser","pure-function"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mishamyrt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-03-08T21:51:01.000Z","updated_at":"2024-12-14T15:36:33.000Z","dependencies_parsed_at":"2023-04-25T03:47:31.779Z","dependency_job_id":null,"html_url":"https://github.com/mishamyrt/compars","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mishamyrt/compars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcompars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcompars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcompars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcompars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mishamyrt","download_url":"https://codeload.github.com/mishamyrt/compars/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcompars/sbom","scorecard":{"id":649581,"data":{"date":"2025-08-11","repo":{"name":"github.com/mishamyrt/compars","commit":"a3fe9101295a1d9fec96a106b423c4cf59f0eb85"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/qa.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/qa.yaml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/mishamyrt/compars/qa.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/qa.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/mishamyrt/compars/qa.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/qa.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/mishamyrt/compars/qa.yaml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T13:08:53.761Z","repository_id":108578155,"created_at":"2025-08-21T13:08:53.762Z","updated_at":"2025-08-21T13:08:53.762Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273850801,"owners_count":25179357,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["comments","golang","parser","pure-function"],"created_at":"2024-11-10T11:17:41.397Z","updated_at":"2025-09-06T02:46:51.540Z","avatar_url":"https://github.com/mishamyrt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compars [![release](https://img.shields.io/github/v/tag/mishamyrt/compars?sort=semver)](https://github.com/mishamyrt/compars/tags)[![Quality assurance](https://github.com/mishamyrt/compars/actions/workflows/qa.yaml/badge.svg)](https://github.com/mishamyrt/compars/actions/workflows/qa.yaml)[![Maintainability](https://api.codeclimate.com/v1/badges/96ab89e362487fda5926/maintainability)](https://codeclimate.com/github/mishamyrt/compars/maintainability)\n\n\u003cimg align=\"right\" width=\"128\" height=\"128\"\n     alt=\"Logo\"\n     src=\"./assets/logo@2x.png\"\u003e\n\nParser of comments in source code. Supports multiple languages through dictionaries. The library contains a pure `Parse` function that returns found comments and their positions\n\n## Features\n\n* Mutli–language\n* Pure functions\n* Memory–frendly\n\n## Usage\n\nThe function needs to pass a `*bufio.Scanner` and a structure of `CommentSymbolSet`. The set can be obtained from the `GetSetByExtension` function, which takes a file extension. The available extensions may be found in the [extensions.go](./pkg/symbols/extensions.go) file.\n\n```go\npackage main\nimport (\n    \"github.com/mishamyrt/compars/v1\"\n    \"github.com/mishamyrt/compars/v1/pkg/symbols\"\n)\n\nfunc main() {\n    file, _ := os.Open(path)\n    set, _ := symbols.GetSetByExtension(\".go\")\n    comments := compars.Parse(file, set)\n    fmt.Printf(\"%d comments are found\", len(comments))\n}\n```\n\nThe result is represented by an array of comment structures.\n\n```go\n// CommentSymbolSet is language-specific symbol set\ntype CommentSymbolSet struct {\n\tInline         string\n\tMultilineStart string\n\tMultilineEnd   string\n}\n```\n\n## Documentation\n\nDocumentation about Compars commands and libraries can be found at usual [godoc.org](https://godoc.org/github.com/mishamyrt/compars).\n\n## License\n\n[MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Fcompars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmishamyrt%2Fcompars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Fcompars/lists"}