Skip to content

Commit

Permalink
Merge pull request #917 from komamitsu/code-format
Browse files Browse the repository at this point in the history
Format the source code
  • Loading branch information
komamitsu authored Nov 9, 2024
2 parents 0baf70c + 70cab0e commit 89b83f8
Show file tree
Hide file tree
Showing 122 changed files with 11,759 additions and 12,772 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/jguttman94/pre-commit-gradle
rev: efaf1704425cc50df91d63920e8353d9d081a622
hooks:
- id: gradle-task
args: [-w, -o, spotlessApply]
verbose: true

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,3 +621,17 @@ Fluency fluency = builder.build();
##### Other configurations

Some of other usages are same as ingestion to Fluentd. See `Ingestion to Fluentd > Usage` above.

## Development

### Pre-commit hook

This project uses [pre-commit](https://pre-commit.com/) to automate code format and so on as much as possible. If you're interested in the development of this project, please [install pre-commit](https://pre-commit.com/#installation) and the git hook script as follows.

```
$ ls -a .pre-commit-config.yaml
.pre-commit-config.yaml
$ pre-commit install
```

The code formatter is automatically executed when committing files. A commit will fail and be formatted by the formatter when any invalid code format is detected. Try to commit the change again.
11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ plugins {
`maven-publish`
id("com.github.kt3k.coveralls") version "2.12.2"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.diffplug.spotless") version "6.13.0"
}

subprojects {
Expand All @@ -26,6 +27,7 @@ subprojects {
apply(plugin = "maven-publish")
apply(plugin = "jacoco")
apply(plugin = "com.github.kt3k.coveralls")
apply(plugin = "com.diffplug.spotless")

repositories {
mavenCentral()
Expand Down Expand Up @@ -187,5 +189,14 @@ subprojects {
tasks.coveralls {
dependsOn(jacocoRootReport)
}

spotless {
java {
target("src/*/java/**/*.java")
importOrder()
removeUnusedImports()
googleJavaFormat("1.7")
}
}
}

Loading

0 comments on commit 89b83f8

Please sign in to comment.