Skip to content

Commit 16f41e7

Browse files
committed
Condense the ratchetFrom CI info.
1 parent e3e8cdb commit 16f41e7

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

plugin-gradle/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,14 +1326,12 @@ However, we strongly recommend that you use a non-local branch, such as a tag or
13261326
13271327
This is especially helpful for injecting accurate copyright dates using the [license step](#license-header).
13281328
1329-
### Using ratchetFrom on CI systems
1329+
### Using `ratchetFrom` on CI systems
13301330
1331-
If you are running Spotless on a CI system, make sure you do not have a shallow clone, or `ratchetFrom` will fail with `No such reference`. Many CI systems use a shallow clone by default for performance reasons. Here is how you turn off shallow clones for some common CI systems:
1331+
Many popular CI systems (GitHub, GitLab, BitBucket, and Travis) use a "shallow clone". This means that `ratchetFrom 'origin/main'` will fail with `No such reference`. You can fix this by:
13321332
1333-
* **GitHub Actions**: Ad `fetch-depth: 0` to `<action>.yml`
1334-
* **GitLab CI**: Add `GIT_DEPTH: 0` under the `variables:` section of `.gitlab-ci.yml`
1335-
* **BitBucket Pipelines**: Add `clone: depth: full` to the build step
1336-
* **Travis**: Add `git: depth: false` in `travis.yml`
1333+
- calling `git fetch origin main` before you call Spotless
1334+
- disabling the shallow clone [like so](https://github.com/diffplug/spotless/issues/710)
13371335
13381336
## `spotless:off` and `spotless:on`
13391337

plugin-maven/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,13 @@ You can explicitly disable ratchet functionality by providing the value 'NONE':
15261526
```
15271527
This is useful for disabling the ratchet functionality in child projects where the parent defines a ratchetFrom value.
15281528

1529+
### Using `ratchetFrom` on CI systems
1530+
1531+
Many popular CI systems (GitHub, GitLab, BitBucket, and Travis) use a "shallow clone". This means that `<ratchetFrom>origin/main</ratchetFrom>` will fail with `No such reference`. You can fix this by:
1532+
1533+
- calling `git fetch origin main` before you call Spotless
1534+
- disabling the shallow clone [like so](https://github.com/diffplug/spotless/issues/710)
1535+
15291536
## `spotless:off` and `spotless:on`
15301537

15311538
Sometimes there is a chunk of code which you have carefully handcrafted, and you would like to exclude just this one little part from getting clobbered by the autoformat. Some formatters have a way to do this, many don't, but who cares. If you setup your spotless like this:

0 commit comments

Comments
 (0)