You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
repository] for specific instructions about the common cases of mongo,
@@ -337,8 +337,6 @@ from the `file` menu.
337
337
338
338
== Contributing
339
339
340
-
:spring-cloud-build-branch: master
341
-
342
340
Spring Cloud is released under the non-restrictive Apache 2.0 license,
343
341
and follows a very standard Github development process, using Github
344
342
tracker for issues and merging pull requests into master. If you want
@@ -382,136 +380,4 @@ added after the original pull request but before a merge.
382
380
other target branch in the main project).
383
381
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
384
382
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
385
-
message (where XXXX is the issue number).
386
-
387
-
=== Checkstyle
388
-
389
-
Spring Cloud Build comes with a set of checkstyle rules. You can find them in the `spring-cloud-build-tools` module. The most notable files under the module are:
390
-
391
-
.spring-cloud-build-tools/
392
-
----
393
-
└── src
394
-
├── checkstyle
395
-
│ └── checkstyle-suppressions.xml <3>
396
-
└── main
397
-
└── resources
398
-
├── checkstyle-header.txt <2>
399
-
└── checkstyle.xml <1>
400
-
----
401
-
<1> Default Checkstyle rules
402
-
<2> File header setup
403
-
<3> Default suppression rules
404
-
405
-
==== Checkstyle configuration
406
-
407
-
Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
<4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
445
-
<5> Add checkstyle plugin to your build and reporting phases
446
-
447
-
If you need to suppress some rules (e.g. line length needs to be longer), then it's enough for you to define a file under `${project.root}/src/checkstyle/checkstyle-suppressions.xml` with your suppressions. Example:
It's advisable to copy the `${spring-cloud-build.rootFolder}/.editorconfig` and `${spring-cloud-build.rootFolder}/.springformat` to your project. That way, some default formatting rules will be applied. You can do so by running this script:
Go to `File` -> `Settings` -> `Editor` -> `Code style`. There click on the icon next to the `Scheme` section. There, click on the `Import Scheme` value and pick the `Intellij IDEA code style XML` option. Import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml` file.
Go to `File` -> `Settings` -> `Editor` -> `Inspections`. There click on the icon next to the `Profile` section. There, click on the `Import Profile` and import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml` file.
504
-
505
-
.Checkstyle
506
-
507
-
To have Intellij work with Checkstyle, you have to install the `Checkstyle` plugin. It's advisable to also install the `Assertions2Assertj` to automatically convert the JUnit assertions
Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on the `+` icon in the `Configuration file` section. There, you'll have to define where the checkstyle rules should be picked from. In the image above, we've picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build's GitHub repository (e.g. for the `checkstyle.xml` : `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
512
-
513
-
- `checkstyle.header.file` - please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
514
-
- `checkstyle.suppressions.file` - default suppressions. Please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
515
-
- `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`.
516
-
517
-
IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
0 commit comments