{"id":24649078,"url":"https://github.com/ow2-proactive/coding-rules","last_synced_at":"2025-08-10T14:18:17.258Z","repository":{"id":146324075,"uuid":"79923401","full_name":"ow2-proactive/coding-rules","owner":"ow2-proactive","description":"Configuration files used to enforce ActiveEon coding guidelines and formatting","archived":false,"fork":false,"pushed_at":"2025-05-12T09:16:52.000Z","size":69,"stargazers_count":0,"open_issues_count":1,"forks_count":5,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-13T12:56:20.728Z","etag":null,"topics":["eclipse","formatter","gradle","guidelines","intellij","preferences"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"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/ow2-proactive.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-01-24T15:21:01.000Z","updated_at":"2024-10-21T08:54:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"d91d1ca1-3278-4499-995f-f3049a5733a0","html_url":"https://github.com/ow2-proactive/coding-rules","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ow2-proactive/coding-rules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fcoding-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fcoding-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fcoding-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fcoding-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ow2-proactive","download_url":"https://codeload.github.com/ow2-proactive/coding-rules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fcoding-rules/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269734658,"owners_count":24466690,"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-08-10T02:00:08.965Z","response_time":71,"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":["eclipse","formatter","gradle","guidelines","intellij","preferences"],"created_at":"2025-01-25T17:15:43.122Z","updated_at":"2025-08-10T14:18:17.206Z","avatar_url":"https://github.com/ow2-proactive.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coding-rules\n\nConfiguration files used to enforce our coding guidelines / formatting\n\n## Clone this project\n* git clone this project somewhere on your PC\n\n## Intellij User\n\n* Use File \u003e Import settings and select settings.jar to import the settings in IntelliJ IDEA.\n* (Optional if you have already the \"Eclipse code formatter\" plugin installed) Install Eclipse Code Formatter plugin from the Plugins dialog screen:\n\n  * on MacOS: Preferences -\u003e Plugins\n  * on GNU/Linux: File -\u003e Settings -\u003e Plugins\n  * on Microsoft Windows: File -\u003e Settings\n  \n  Click on Browse repositories, search for \"Eclipse Code Formatter\" and click on Install.\n  To load this new plugin, you will need to restart IntelliJ.\n* Open up the Eclipse Code Formatter dialog screen:\n\n  * on MacOS: Preferences -\u003e Eclipse Code Formatter\n  * on GNU/Linux: File -\u003e Settings -\u003e Eclipse Code Formatter\n  * on Microsoft Windows: File -\u003e Settings -\u003e Other Settings -\u003e Eclipse Code Formatter\n  \n* Enable the plugin by ticking \"Use the Eclipse code formatter\"\n* Setting \"Eclipse Java Formatter config file\" by using the `src/main/resource/ProactiveCodeFormatter.xml`\n* Make sure the ProActive Rules is selected as \"Java formatter profile\"\n* Tick \"Optimize Imports\"\n* Select \"Import order from file\", which uses `src/main/resources/proactive.importorder`\n* Click on Apply or OK\n* Make sure that the selected Code Style Scheme is \"Proactive\" by opening the Code Style dialog screen:\n\n  * on MacOS: Preferences -\u003e Editor -\u003e Code Style\n  * on GNU/Linux: File -\u003e Settings -\u003e Editor -\u003e Code Style\n\n## Eclipse User\n\nDownload Eclipse_Preferences.epf file (https://github.com/ow2-proactive/coding-rules/blob/master/Eclipse_Preferences.epf), and import it by doing in Eclipse: File \u003e Import \u003e General \u003e Preferences, browse to file and Finish. This epf file contains already the ProactiveCodeFormatter.xml, no need to import the formatter again.\n\n\n## Code format during the project build\n\n1.Merge the following buildscript into your project's build.gradle file\n\n```\nbuildscript {\n    repositories {\n        maven { \n            url \"https://plugins.gradle.org/m2/\"\n        }\n        maven {        \n            url \"http://repository.activeeon.com/content/groups/proactive/\"\n        }       \n    }\n\n    dependencies {\n        classpath \"com.diffplug.gradle.spotless:spotless:2.4.0\"\n        classpath \"org.ow2.proactive:coding-rules:1.0.0\"\n        delete \"gradle/ext\"\n        ant.unjar src: configurations.classpath.find { it.name.startsWith(\"coding-rules\") }, dest: 'gradle/ext'\n    }\n}\n```\n\n2.Apply the code format plugin in your project's build.gradle file with\n\n```\napply from: \"$rootDir/gradle/ext/coding-format.gradle\"\n```\n\n3.Update your project's .gitignore by adding the line below to ignore the temporary folder\n\n```\ngradle/ext/\n```\n4.Build your project as usual, if any java files are bad formatted, build will fail with messages telling you to build again with task \"spotlessApply\".\n\n5.Build again with either the custom task \"formatCode\" (defined in coding-format.gradle) or plugin task \"spotlessApply\" will automatically format your whole project.\n\n## Issue you may have after having applied the changes\n\n### 1. gradle build failure\nSome projects may have a build exception after having applied the changes above, the exception message looks like the following\n\n```\nAn exception occurred applying plugin request [id: 'org.sonarqube', version: '2.2.1']\n\u003e Cannot change dependencies of configuration ':classpath' after it has been resolved.\n```\n\nThis is because the sonarqube plugin is applied within the \"plugins\" block like this\n\n```\nplugins {\n    id 'org.sonarqube' version '2.2.1'\n}\n```\n\nThe only way to solve this issue so far is to apply the plugin in the traditional manner, add dependencies in the \"buildscript\" block like this\n\n```\ndependencies {\n        classpath \"org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2.1\"\n    }\n```\n\nthen apply the plugin like this\n\n```\napply plugin: 'org.sonarqube'\n```\n\n### 2. Code format check failure in windows\nDue to the fact that the line ending character used in windows and in linux is different, the code format check might be failed in Windows environment.\n\nThe fix is to create `.gitattributes` file in the project's root path with the following content, this will force git to use the fix line ending character while checking out the project.\n\n```\n*.java eol=lf\n*.gradle eol=lf\n*.sh eol=lf\n*.md eol=lf\n\n*.bat eol=crlf\n\n*.png binary\n*.jpg binary\n```\n\nRun the following git commands on the jenkins windows slave machine to apply the `.gitattributes` rules inside the git local working directory, otherwise the current working directory will still have the windows line ending character.\n\n1. `git rm --cached -r .`\n2. `git reset --hard`\n\nThe jenkins workspace directory is kind of like `C:\\jenkins\\workspace\\${project_name}\\jdk\\JDK8\\label\\Windows`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fow2-proactive%2Fcoding-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fow2-proactive%2Fcoding-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fow2-proactive%2Fcoding-rules/lists"}