{"id":19359859,"url":"https://github.com/codacy/codacy-codenarc","last_synced_at":"2025-06-14T03:35:06.552Z","repository":{"id":40507705,"uuid":"226925033","full_name":"codacy/codacy-codenarc","owner":"codacy","description":"Codacy Tool for CodeNarc","archived":false,"fork":false,"pushed_at":"2025-03-28T12:18:38.000Z","size":581,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-13T11:57:28.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codacy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-09T17:09:11.000Z","updated_at":"2025-03-28T12:15:44.000Z","dependencies_parsed_at":"2022-08-09T22:22:24.908Z","dependency_job_id":"a3e1786d-f728-4240-905f-d331e48f5137","html_url":"https://github.com/codacy/codacy-codenarc","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/codacy/codacy-codenarc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-codenarc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-codenarc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-codenarc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-codenarc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codacy","download_url":"https://codeload.github.com/codacy/codacy-codenarc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-codenarc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259754865,"owners_count":22906463,"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-11-10T07:16:22.127Z","updated_at":"2025-06-14T03:35:06.505Z","avatar_url":"https://github.com/codacy.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codacy-codenarc\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2ac2eab19b9742d09074afb40bc932ff)](https://app.codacy.com/gh/codacy/codacy-codenarc?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=codacy/codacy-codenarc\u0026utm_campaign=Badge_Grade_Settings)\n\nDocker engine to allow Codacy to have [CodeNarc](https://github.com/CodeNarc/CodeNarc) support.\n\n## Usage\n\nYou can create the docker by doing:\n\n    sbt docker:publishLocal\n\nThe docker is ran with the following command:\n\n    docker run -it -v $srcDir:/src \u003cDOCKER_NAME\u003e:\u003cDOCKER_VERSION\u003e\n\nTo run the tool using a custom configuration file, run docker with the following command:\n\n    docker run -it -v $srcDir:/src -v $codacyrcConfig:/.codacyrc \u003cDOCKER_NAME\u003e:\u003cDOCKER_VERSION\u003e\n\n## Tool Developer Documentation\n\n[Tool Developer Guide](https://support.codacy.com/hc/en-us/articles/207994725-Tool-Developer-Guide)\n\n\n[Tool Developer Guide - Using Scala](https://support.codacy.com/hc/en-us/articles/207280379-Tool-Developer-Guide-Using-Scala)\n\n\n## Structure\n\n- To run the tool we provide the configuration file, ```/.codacyrc```, with the language to run and optional parameters your tool might need.\n- The source code to be analysed will be located in ```/src```, meaning that when provided in the configuration, the file paths are relative to ```/src```.\n\n#### Configuration file (.codacyrc)\n\nThis file has:\n\n - files: Files to be analysed (their path is relative to ```/src```)\n - tools: Array of tools\n - name: Unique identifier of the tool. This will be provided by the tool in patterns.json file.\n - patterns: Array of patterns that must be checked\n     - patternId: Unique identifier of the pattern\n     - parameters: Parameters of the pattern\n     - name: Unique identifier of the parameter\n     - value: Value to be used as parameter value\n\n```\n{\n  \"files\" : [\"foo/bar/baz.groovy\", \"foo2/bar/baz.groovy\"],\n  \"tools\":[\n    {\n      \"name\":\"codenarc\",\n      \"patterns\":[\n        {\n          \"patternId\":\"AssignmentInConditional\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n#### Tool documentation\n\nAt Codacy we strive to provide the best value to our users and, to accomplish that, we document our patterns so that the user can better understand the problem and fix it.\n\nThe documentation for the tool must always be updated before submitting the docker.\n\nYour files for this section should be placed in ```/docs/description/```.\n\nIn order to provide more details you can create:\n\n- A single ```/docs/description/description.json```\n- A ```/docs/description/\u003cPATTERN-ID\u003e.md``` for each pattern\n\n\nIn the description.json you define the title for the pattern, brief description, time to fix (in minutes), and also a description of the parameters in the following format:\n\n```\n[\n  {\n    \"patternId\" : \"EmptyCatchBlock\",\n    \"title\" : \"EmptyCatchBlock\",\n    \"description\" : \"EmptyCatchBlock.description=In most cases, exceptions should not be caught and ignored (swallowed).\",\n    \"parameters\" : [ {\n      \"name\" : \"ignoreRegex\",\n      \"description\" : \"\"\n    } ]\n  }\n]\n```\n\nTo give a more detailed explanation about the issue, you should define the ```\u003cPATTERN-ID\u003e.md```. Example:\n\n```\nChecks for empty *catch* blocks. In most cases, exceptions should not be caught and ignored (swallowed).\n\nThe rule has a property named `ignoreRegex` that defaults to the value 'ignore|ignored'. If the name of the exception\nmatches this regex then no violations are produced.\n\n| Property                    | Description            | Default Value    |\n|-----------------------------|------------------------|------------------|\n| ignoreRegex                 | Regular expression - exception parameter names matching this regular expression are ignored and no violations are produced. | 'ignore\\|ignored' |\n\nHere is an example of code that produces a violation:\n\n        def myMethod() {\n        try {\n            doSomething\n        } catch(MyException e) {                //violation\n            // should do something here\n        }\n    }\n\n    def myMethod() {\n        try {\n            doSomething\n        } catch(MyException ignored) {\n            //no violations because the parameter name is ignored\n        }\n    }\n```\n\nThis documentation should be generated automatically by using the Documentation Generator tool:\n\n```\nsbt \"docGenerator / runMain codacy.codenarc.docs.DocGenerator\"\n```\n\n\n#### Test\n\nFollow the instructions at [codacy-plugins-test](https://github.com/codacy/codacy-plugins-test).\n\n\n## What is Codacy\n\n[Codacy](https://www.codacy.com/) is an Automated Code Review Tool that monitors\nyour technical debt, helps you improve your code quality, teaches best practices\nto your developers, and helps you save time in Code Reviews.\n\n### Among Codacy’s features\n\n* Identify new Static Analysis issues\n* Commit and Pull Request Analysis with GitHub, BitBucket/Stash, GitLab (and\n  also direct git repositories)\n* Auto-comments on Commits and Pull Requests\n* Integrations with Slack, HipChat, Jira, YouTrack\n* Track issues in Code Style, Security, Error Proneness, Performance, Unused\n  Code and other categories\n\nCodacy also helps keep track of Code Coverage, Code Duplication, and Code\nComplexity.\n\nCodacy supports PHP, Python, Ruby, Java, JavaScript, and Scala, among others.\n\n### Free for Open Source\n\nCodacy is free for Open Source projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodacy%2Fcodacy-codenarc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodacy%2Fcodacy-codenarc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodacy%2Fcodacy-codenarc/lists"}