Allow skipping sortPom

Open
#2,849 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Start in plugin-maven/src/main/java/com/diffplug/spotless/maven/pom/Pom.java, especially the hardcoded pom.xml handling, and compare it with how other formatters apply filename regular expressions. Done means sortPom can target secondary POM filenames and can be bypassed through the same kind of configuration described in the issue.

Written by the indexing model from the issue text.

Description

While other formatters allow to set some sort of regular expression to signal which files should be processed, sortPom formatting does not have this option (while sortPom has), pom.xml is hardcoded. This has two drawbacks:

  • secondary poms can't be processed by sortPom; i.e., we have some poms that invoke a "secondary" pom in the same folder, which for obvious reasons can't be named pom.xml
  • it doesn't allow to bypass sortPom formatting. Currently we define some properties at the corporate pom level that allow to disable certain spotless formatters, via the regexs above, so it's easy to skip formatting, or apply it only to a subset of elements

would be nice to have this option for sortPom too. Thanks!

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.