|
151 | 151 | <jakarta.validation-api.version>2.0.2</jakarta.validation-api.version>
|
152 | 152 | <javassist.version>3.30.2-GA</javassist.version>
|
153 | 153 | <jackson-jaxrs-json-provider.version>2.17.3</jackson-jaxrs-json-provider.version>
|
| 154 | + <spotless.version>2.44.2</spotless.version> |
154 | 155 | </properties>
|
155 | 156 | <build>
|
156 | 157 | <pluginManagement>
|
|
394 | 395 | </execution>
|
395 | 396 | </executions>
|
396 | 397 | </plugin>
|
| 398 | + <plugin> |
| 399 | + <groupId>com.diffplug.spotless</groupId> |
| 400 | + <artifactId>spotless-maven-plugin</artifactId> |
| 401 | + <version>${spotless.version}</version> |
| 402 | + <configuration> |
| 403 | + <!-- define a language-specific format --> |
| 404 | + <java> |
| 405 | + <includes> |
| 406 | + <include>**/org/apache/hbase/htrace_noop/**</include> |
| 407 | + <include>**/org/apache/hadoop/hbase/unsafe/**</include> |
| 408 | + </includes> |
| 409 | + <!-- |
| 410 | + e.g., remove the following lines: |
| 411 | + "* @param paramName" |
| 412 | + "* @throws ExceptionType" |
| 413 | + "* @return returnType"' |
| 414 | + Multiline to allow anchors on newlines |
| 415 | + See https://errorprone.info/bugpattern/EmptyBlockTag |
| 416 | + --> |
| 417 | + <replaceRegex> |
| 418 | + <name>Remove unhelpful javadoc stubs</name> |
| 419 | + <searchRegex>(?m)^ *\* *@(?:param|throws|return) *\w* *\n</searchRegex> |
| 420 | + <replacement/> |
| 421 | + </replaceRegex> |
| 422 | + <!-- |
| 423 | + e.g., rewrite |
| 424 | + /** @return blabla */ |
| 425 | + or |
| 426 | + /** |
| 427 | + * @return blabla |
| 428 | + */ |
| 429 | + to |
| 430 | + /** Returns blabla */ |
| 431 | + See https://errorprone.info/bugpattern/MissingSummary |
| 432 | + https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment |
| 433 | + --> |
| 434 | + <replaceRegex> |
| 435 | + <name>Purge single returns tag multi line</name> |
| 436 | + <searchRegex>(?m)^ */\*\*\n *\* *@return *(.*) *\n *\*/$</searchRegex> |
| 437 | + <replacement>/** Returns $1 */</replacement> |
| 438 | + </replaceRegex> |
| 439 | + <replaceRegex> |
| 440 | + <name>Purge single returns tag single line</name> |
| 441 | + <searchRegex>^ */\*\* *@return *(.*) *\*/$</searchRegex> |
| 442 | + <replacement>/** Returns $1 */</replacement> |
| 443 | + </replaceRegex> |
| 444 | + <!-- apply a specific flavor --> |
| 445 | + <eclipse> |
| 446 | + <file>${session.executionRootDirectory}/dev-support/hbase_eclipse_formatter.xml</file> |
| 447 | + </eclipse> |
| 448 | + <importOrder> |
| 449 | + <file>${session.executionRootDirectory}/dev-support/eclipse.importorder</file> |
| 450 | + </importOrder> |
| 451 | + <trimTrailingWhitespace/> |
| 452 | + <endWithNewline/> |
| 453 | + <removeUnusedImports/> |
| 454 | + </java> |
| 455 | + <pom> |
| 456 | + <sortPom> |
| 457 | + <expandEmptyElements>false</expandEmptyElements> |
| 458 | + </sortPom> |
| 459 | + </pom> |
| 460 | + <formats> |
| 461 | + <!-- you can define as many formats as you want, each is independent --> |
| 462 | + <format> |
| 463 | + <!-- define the files to apply to --> |
| 464 | + <includes> |
| 465 | + <include>**/*.xml</include> |
| 466 | + <include>**/*.sh</include> |
| 467 | + <include>**/*.py</include> |
| 468 | + <include>**/Jenkinsfile*</include> |
| 469 | + <include>**/*.md</include> |
| 470 | + <include>*.md</include> |
| 471 | + <include>**/*.txt</include> |
| 472 | + <include>*.txt</include> |
| 473 | + </includes> |
| 474 | + <excludes> |
| 475 | + <exclude>**/target/**</exclude> |
| 476 | + <exclude>**/dependency-reduced-pom.xml</exclude> |
| 477 | + <exclude>**/.idea/**</exclude> |
| 478 | + </excludes> |
| 479 | + <!-- define the steps to apply to those files --> |
| 480 | + <trimTrailingWhitespace/> |
| 481 | + <endWithNewline/> |
| 482 | + </format> |
| 483 | + <format> |
| 484 | + <includes> |
| 485 | + <include>**/org/apache/hbase/htrace_noop/**</include> |
| 486 | + <include>**/org/apache/hadoop/hbase/unsafe/**</include> |
| 487 | + </includes> |
| 488 | + <licenseHeader> |
| 489 | + <file>${session.executionRootDirectory}/dev-support/license-header</file> |
| 490 | + <delimiter>package</delimiter> |
| 491 | + </licenseHeader> |
| 492 | + </format> |
| 493 | + </formats> |
| 494 | + </configuration> |
| 495 | + </plugin> |
397 | 496 | </plugins>
|
398 | 497 | <extensions>
|
399 | 498 | <extension>
|
|
0 commit comments