Skip to content

Commit f860981

Browse files
authored
feat: improve docs and branding (#2)
2 parents c03c39b + 8bbfdbf commit f860981

File tree

11 files changed

+262
-20
lines changed

11 files changed

+262
-20
lines changed

.github/ISSUE_TEMPLATE/01-bug.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
name: Report a Bug
3+
description: File a bug report for spotless-cli
4+
title: "[BUG]: "
5+
labels: ["bug-unconfirmed"]
6+
assignees: []
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thank you for reporting a bug! Please take the time to fill out the following form so that we can
12+
understand and reproduce the issue.
13+
14+
Before submitting:
15+
- Have you checked for **existing issues** in both [`spotless-cli`](https://github.com/diffplug/spotless-cli/issues) and [`spotless`](https://github.com/diffplug/spotless/issues)?
16+
- Is this issue about formatting behavior that might belong to the [`spotless`](https://github.com/diffplug/spotless) library instead?
17+
18+
- type: checkboxes
19+
id: pre_submission_checklist
20+
attributes:
21+
label: Pre-submission checks
22+
description: Please confirm the following before submitting.
23+
options:
24+
- label: I have searched for [existing issues in spotless-cli](https://github.com/diffplug/spotless-cli/issues).
25+
required: true
26+
- label: I have searched for [existing issues in spotless](https://github.com/diffplug/spotless/issues).
27+
required: true
28+
- label: This issue is specific to `spotless-cli`, and not just the formatting logic in `spotless-lib`.
29+
required: true
30+
31+
- type: textarea
32+
id: cli-version
33+
attributes:
34+
label: spotless-cli version
35+
description: Run `spotless --version` to get the version.
36+
placeholder: |
37+
e.g.
38+
--------------------------------------------------
39+
🧼 Spotless CLI 0.1.0
40+
--------------------------------------------------
41+
42+
spotless-lib: 3.1.0
43+
spotless-lib-extra: 3.1.0
44+
validations:
45+
required: true
46+
47+
- type: dropdown
48+
id: os
49+
attributes:
50+
label: Operating system and architecture
51+
options:
52+
- macOS (Intel)
53+
- macOS (Apple Silicon / ARM)
54+
- Linux (Intel)
55+
- Linux (ARM)
56+
- Windows (x64)
57+
- I don't know (Please specify in the comment section)
58+
validations:
59+
required: true
60+
61+
# # # #
62+
- type: textarea
63+
id: command
64+
attributes:
65+
label: CLI command used
66+
description: The exact `spotless` command you ran.
67+
placeholder: |
68+
e.g. spotless --target '**/src/**/*.java' \
69+
google-java-format \
70+
license-header --header='/* (c) DiffPlug $YEAR */'
71+
validations:
72+
required: true
73+
74+
- type: textarea
75+
id: problem
76+
attributes:
77+
label: Description of the problem
78+
description: What did you expect to happen, and what actually happened?
79+
placeholder: Describe the unexpected behavior in detail.
80+
validations:
81+
required: true
82+
83+
- type: textarea
84+
id: logs
85+
attributes:
86+
label: Logs from the command line
87+
description: Please re-run your command with `-vvvvv` and paste the output here.
88+
validations:
89+
required: true
90+
91+
- type: textarea
92+
id: reproducibility
93+
attributes:
94+
label: Steps to reproduce
95+
description: How can we reproduce the issue? Include the minimum files and configuration needed.
96+
placeholder: |
97+
1. Create a file with the following content...
98+
2. Use this `.spotless.yaml` config...
99+
3. Run `spotless apply` and observe...
100+
validations:
101+
required: true
102+
103+
- type: textarea
104+
id: additional
105+
attributes:
106+
label: Additional context
107+
description: Include any error logs, stack traces, screenshots, or references to related issues.
108+
placeholder: |
109+
- stack trace here
110+
- related issue: #123
111+
- logs from console...
112+
validations:
113+
required: false
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Feature request
2+
description: Suggest a new feature or enhancement for spotless-cli
3+
title: "[Feature Request]: "
4+
labels: ["enhancement"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thank you for suggesting a feature!
12+
13+
Please make sure your idea aligns with the goals of `spotless-cli`, which is a thin CLI layer around `spotless-lib`.
14+
15+
- type: textarea
16+
id: cli-version
17+
attributes:
18+
label: spotless-cli version (if relevant)
19+
description: If your request is based on a current limitation or behavior.
20+
placeholder: |
21+
e.g.
22+
--------------------------------------------------
23+
🧼 Spotless CLI 0.1.0
24+
--------------------------------------------------
25+
26+
spotless-lib: 3.1.0
27+
spotless-lib-extra: 3.1.0
28+
validations:
29+
required: false
30+
31+
- type: textarea
32+
id: feature-description
33+
attributes:
34+
label: Describe the feature
35+
description: What functionality would you like to see added?
36+
placeholder: |
37+
I would like to see support for...
38+
It would help because...
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: motivation
44+
attributes:
45+
label: Motivation and use case
46+
description: Why is this feature important to you? What problem does it solve?
47+
placeholder: This feature would be useful for projects that...
48+
validations:
49+
required: true
50+
51+
- type: textarea
52+
id: alternatives
53+
attributes:
54+
label: Alternatives considered
55+
description: Have you considered any workarounds or other tools?
56+
placeholder: Currently, I'm working around it by...
57+
validations:
58+
required: false
59+
60+
- type: dropdown
61+
id: scope
62+
attributes:
63+
label: Feature scope
64+
description: Where do you think this feature belongs?
65+
options:
66+
- label: This should be implemented in `spotless-cli`.
67+
- label: This may belong in `spotless-lib` instead.
68+
- label: Not sure.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
blank_issues_enabled: true
3+
contact_links:
4+
- name: Spotless Core Library Issues
5+
url: https://github.com/diffplug/spotless/issues
6+
about: Report an issue with the Spotless Core Library (if you suspect the bug to be inside the formatter itself).

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# <img align="left" src="../_images/spotless_logo.png"> Spotless Command Line Interface CLI
1+
# <img align="left" src="docs/logo/spotless_banner.png" alt="Banner introducing spotless cli"> Spotless Command Line Interface CLI
22

33
_Keep your code Spotless from the command line_
44

55
<!---freshmark shields
66
output = [
7-
link(shield('Changelog', 'changelog', '{{versionLast}}', 'blue'), 'CHANGES.md'),
7+
link(shield('SpotlessCLI Version', 'latest-version', '{{spotlessVersion}}', 'blue'), 'CHANGES.md'),
88
'',
9-
link(shield('OS Win', 'OS', 'Windows', 'blueviolet'), 'README.md'),
10-
link(shield('OS Linux', 'OS', 'Linux', 'blueviolet'), 'README.md'),
11-
link(shield('OS macOS', 'OS', 'macOS', 'blueviolet'), 'README.md'),
9+
link(shield('OS Win', 'OS', 'Windows', 'blueviolet'), '#installation-on-windows'),
10+
link(shield('OS Linux', 'OS', 'Linux', 'blueviolet'), '#installation-on-macos-and-linux'),
11+
link(shield('OS macOS', 'OS', 'macOS', 'blueviolet'), '#installation-on-macos-and-linux'),
1212
].join('\n')
1313
-->
1414

15-
[![Changelog](https://img.shields.io/badge/changelog-versionLast%3DUNKNOWN-blue.svg)](CHANGES.md)
15+
[![SpotlessCLI Version](https://img.shields.io/badge/latest--version-0.1.0-blue.svg)](CHANGES.md)
1616

17-
[![OS Win](https://img.shields.io/badge/OS-Windows-blueviolet.svg)](README.md)
18-
[![OS Linux](https://img.shields.io/badge/OS-Linux-blueviolet.svg)](README.md)
19-
[![OS macOS](https://img.shields.io/badge/OS-macOS-blueviolet.svg)](README.md)
17+
[![OS Win](https://img.shields.io/badge/OS-Windows-blueviolet.svg)](#installation-on-windows)
18+
[![OS Linux](https://img.shields.io/badge/OS-Linux-blueviolet.svg)](#installation-on-macos-and-linux)
19+
[![OS macOS](https://img.shields.io/badge/OS-macOS-blueviolet.svg)](#installation-on-macos-and-linux)
2020

2121
<!---freshmark /shields -->
2222

@@ -57,7 +57,9 @@ output = [
5757

5858
## Installation
5959

60-
To install with Homebrew on macOS or Linux:
60+
### Installation on macOS and Linux
61+
62+
To install with [Homebrew](https://brew.sh/) on macOS or Linux:
6163

6264
```shell
6365
brew install diffplug/tap/spotless-cli
@@ -67,10 +69,12 @@ brew tap diffplug/tap
6769
brew install spotless-cli
6870
```
6971

70-
To install with Chocolatey on Windows:
72+
### Installation on Windows
73+
74+
To install with [Chocolatey](https://chocolatey.org/) on Windows:
7175

7276
```shell
73-
choco install ...
77+
choco install spotless-cli
7478
```
7579

7680
Alternatively, you can download the latest binary for your system from the [releases page](https://...) and add it to your PATH.

build-logic/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies {
2020
implementation 'com.gradleup.shadow:shadow-gradle-plugin:8.3.6'
2121
implementation 'org.graalvm.buildtools:native-gradle-plugin:0.10.5'
2222
implementation libs.bundles.spotless.libs
23+
implementation libs.spotless.plugin.gradle
2324
}
2425

2526
spotless {

build-logic/src/main/groovy/buildlogic.spotless-markdown-conventions.gradle

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,65 @@
11
import com.diffplug.spotless.cli.picocli.usage.DocumentedUsages
2+
import com.diffplug.gradle.spotless.FreshMarkExtension
3+
import com.oracle.svm.core.annotate.Inject
24

35
plugins {
46
id 'buildlogic.spotless-common-conventions'
7+
id 'com.diffplug.spotless-changelog'
58
}
69

10+
Action<FreshMarkExtension> freshmarkSetup = new Action<FreshMarkExtension>(){
11+
12+
void execute(FreshMarkExtension freshmark) {
13+
freshmark.target '*.md'
14+
freshmark.properties(new FreshmarkPropertiesAction(rootProject, project))
15+
freshmark.properties {
16+
it.put('changeThisValueToForceCacheMiss', '1f31705c-b1c6-4bce-9831-98881431b721')
17+
}
18+
freshmark.prettier() // prettier for markdown formatting
19+
freshmark.endWithNewline()
20+
}
21+
}
22+
723
spotless {
824
freshmark {
925
// freshmark for keeping markdown files up to date
10-
target '*.md'
11-
// provide lib versions to freshmark
12-
properties(new FreshmarkPropertiesAction(rootProject, project))
13-
properties {
14-
it.put('changeThisValueToForceCacheMiss', '1f31705c-b1c6-4bce-9831-98881431b721')
26+
freshmarkSetup.execute(it)
27+
}
28+
}
29+
30+
interface MarkdownProjInjections {
31+
@javax.inject.Inject
32+
ExecOperations getExecOperations()
33+
}
34+
35+
// if this freshmark has a changelog file, then it has version-sensitive content
36+
if (tasks.names.contains('changelogCheck')) {
37+
// create a freshmark apply task manually
38+
FreshMarkExtension freshmark = new FreshMarkExtension(spotless)
39+
freshmarkSetup.execute(freshmark)
40+
// override version for this task, we want to use versionNext because versionLast is bumped after evaluation, so peek ahead
41+
freshmark.properties {
42+
it.put('spotlessVersion', rootProject.spotlessChangelog.versionNext)
43+
}
44+
def changelogBumpFreshmark = freshmark.createIndependentApplyTask('changelogBumpFreshmark')
45+
// freshmark should run after the changelog bump
46+
changelogBumpFreshmark.dependsOn tasks.named('changelogBump')
47+
48+
def changelogBumpFreshmarkGitAdd = tasks.register('changelogBumpFreshmarkGitAdd') {
49+
def execOps = project.objects.newInstance(MarkdownProjInjections).execOperations
50+
// this git add should run after the freshmark
51+
dependsOn(changelogBumpFreshmark)
52+
// do the git add
53+
doLast {
54+
execOps.exec { commandLine 'git', 'add' , '*.md' }
1555
}
16-
prettier() // prettier for markdown formatting
17-
endWithNewline()
56+
}
57+
tasks.named('changelogPush').configure {
58+
dependsOn changelogBumpFreshmarkGitAdd
1859
}
1960
}
2061

62+
2163
class FreshmarkPropertiesAction implements Action<Map<String, Object>> {
2264

2365
private final Project rootProject
@@ -34,6 +76,7 @@ class FreshmarkPropertiesAction implements Action<Map<String, Object>> {
3476
properties.putAll(versionsCollected)
3577
def usageHelps = getUsageHelps()
3678
properties.putAll(usageHelps)
79+
properties.put('spotlessVersion', rootProject.spotlessChangelog.versionLast)
3780
}
3881

3982
Map<String, String> getVersionsCollected() {

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import com.diffplug.spotless.cli.io.CopySingleTemplateFileTask
33
plugins {
44
id 'buildlogic.spotless-gradle-conventions'
55
id 'buildlogic.spotless-json-conventions'
6+
id 'buildlogic.changelog-conventions'
67
id 'buildlogic.spotless-markdown-conventions'
78
id 'buildlogic.spotless-yaml-conventions'
8-
id 'buildlogic.changelog-conventions'
99
}
1010

1111
subprojects {

docs/logo/spotless-brush-256.png

39.6 KB
Loading

docs/logo/spotless_banner.png

147 KB
Loading

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ picocli = "4.7.6"
1111
selfie = "2.5.1"
1212
slf4j = "2.0.17"
1313
spotless-lib = "3.1.0"
14+
spotless-plugin-gradle = "7.0.2"
1415

1516
[libraries]
1617
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }
@@ -31,6 +32,7 @@ slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
3132
slf4j-binding = { module = "org.slf4j:slf4j-jdk14", version.ref = "slf4j" }
3233
spotless-lib = { module = "com.diffplug.spotless:spotless-lib", version.ref = "spotless-lib" }
3334
spotless-lib-extra = { module = "com.diffplug.spotless:spotless-lib-extra", version.ref = "spotless-lib" }
35+
spotless-plugin-gradle = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless-plugin-gradle" }
3436

3537
[bundles]
3638
durian-libs = ["durian-core", "durian-io", "durian-collect"]

0 commit comments

Comments
 (0)