{"id":20428279,"url":"https://github.com/tomasbjerre/violation-comments-lib","last_synced_at":"2025-04-12T19:23:53.169Z","repository":{"id":5477916,"uuid":"53081543","full_name":"tomasbjerre/violation-comments-lib","owner":"tomasbjerre","description":"Library for commenting things with violations from static code analysis.","archived":false,"fork":false,"pushed_at":"2024-11-09T15:50:04.000Z","size":502,"stargazers_count":12,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T13:45:32.108Z","etag":null,"topics":["static-code-analysis"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/tomasbjerre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["tomasbjerre"]}},"created_at":"2016-03-03T20:39:54.000Z","updated_at":"2024-11-09T15:50:08.000Z","dependencies_parsed_at":"2024-11-09T16:26:24.812Z","dependency_job_id":null,"html_url":"https://github.com/tomasbjerre/violation-comments-lib","commit_stats":null,"previous_names":[],"tags_count":110,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fviolation-comments-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fviolation-comments-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fviolation-comments-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fviolation-comments-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasbjerre","download_url":"https://codeload.github.com/tomasbjerre/violation-comments-lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248619248,"owners_count":21134379,"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":["static-code-analysis"],"created_at":"2024-11-15T07:24:57.951Z","updated_at":"2025-04-12T19:23:53.147Z","avatar_url":"https://github.com/tomasbjerre.png","language":"Java","readme":"# Violation Comments Lib\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/se.bjurr.violations/violation-comments-lib/badge.svg)](https://maven-badges.herokuapp.com/maven-central/se.bjurr.violations/violation-comments-lib)\n\nThis is a library that helps working with comments from static code analysis.\n\nIt supports the same formats as [Violations Lib](https://github.com/tomasbjerre/violations-lib).\n\nIt is used by these libraries:\n\n* [Violation Comments to GitHub Lib](https://github.com/tomasbjerre/violation-comments-to-github-lib).\n* [Violation Comments to GitLab Lib](https://github.com/tomasbjerre/violation-comments-to-gitlab-lib).\n* [Violation Comments to Bitbucket Server Lib](https://github.com/tomasbjerre/violation-comments-to-bitbucket-server-lib).\n* [Violation Comments to Bitbucket Cloud Lib](https://github.com/tomasbjerre/violation-comments-to-bitbucket-cloud-lib)\n\n## Template\n\nIt uses a template to render each violation comment. There is a default that can be replaced with a custom template.\n\nThe context available when the template is rendered is:\n\n* `violation` that is an instance of [Violation](src/main/java/se/bjurr/violations/comments/lib/model/ViolationData.java).\n* `changedFile` that is an instance of [ChangedFile](src/main/java/se/bjurr/violations/comments/lib/model/ChangedFile.java).\n\nThe templating language is [Handlebars](https://github.com/jknack/handlebars.java) and may look like:\n\n```hbs\n**Reporter**: {{violation.reporter}}{{#violation.rule}}\n\n**Rule**: {{violation.rule}}{{/violation.rule}}\n**Severity**: {{violation.severity}}\n**File**: {{changedFile.filename}} L{{violation.startLine}}{{#violation.source}}\n\n**Source**: {{violation.source}}{{/violation.source}}\n\n{{violation.message}}\n```\n\nYou can avoid escaping (replaces new lines with `\u0026#10;`) by using triple `{` like this:\n\n```hbs\n{{{violation.message}}}\n```\n\nWhen using command line tools you may have problems with the ` (accent) character. You can do:\n\n```bash\n...\n-comment-template \"\nmessage: \n\\\\\\`\\\\\\`\\\\\\`\n{{{violation.message}}}\n\\\\\\`\\\\\\`\\\\\\`\n\"\n```\n\nAnd it will surround the `message` with triple ```.\n\n### Helpers\n\nThe Handlebars library comes with [helper methods](https://github.com/jknack/handlebars.java/tree/master/handlebars/src/main/java/com/github/jknack/handlebars/helper), these are registered:\n\n* `ConditionalHelpers`\n* `IfHelper`\n* `StringHelpers`\n* `UnlessHelper`\n","funding_links":["https://github.com/sponsors/tomasbjerre"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasbjerre%2Fviolation-comments-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasbjerre%2Fviolation-comments-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasbjerre%2Fviolation-comments-lib/lists"}