Skip to content
This repository was archived by the owner on Jun 18, 2023. It is now read-only.

Commit da34f1d

Browse files
committed
feat: Add spotless code formatter with prettier
1 parent ee601db commit da34f1d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ The application renders content based on mock data in `src/app/shared/mock`.
2626
It contains multiple mocks - including the ones from the springwolf-core examples projects.
2727

2828
To update the mock data, run `npm run update-mocks`.
29+
30+
### Code Formatting
31+
32+
The project uses spotless together with prettier for code formatting.
33+
Using the gradle task `spotlessApply`, the code is reformatted to match the style.

build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id 'com.github.node-gradle.node' version '2.2.4'
44
id 'signing'
55
id 'maven-publish'
6+
id "com.diffplug.spotless" version "5.0.0"
67
}
78

89
group = 'io.github.springwolf'
@@ -16,6 +17,8 @@ node {
1617
}
1718

1819
npm_run_build {
20+
dependsOn spotlessCheck
21+
1922
inputs.files fileTree("src")
2023
inputs.file 'angular.json'
2124
inputs.file 'package.json'
@@ -124,3 +127,15 @@ publishing {
124127
}
125128
}
126129
}
130+
131+
spotless {
132+
encoding 'UTF-8'
133+
134+
format 'Angular', {
135+
target 'src/**/*.ts', 'src/**/*.css', 'src/**/*.html'
136+
137+
trimTrailingWhitespace()
138+
endWithNewline()
139+
prettier().config(["singleQuote": true])
140+
}
141+
}

0 commit comments

Comments
 (0)