Comments (3)
The plugin can only verify whether the formatter plugin would have changed a file if it had been used to perform the formatting. It doesn't know which lines are the problem. It just signals you need to run the formatting task. If you use the plugin to format the file that caused the error, then you can easily perform a diff on the two files to see where the problem was. Reporting the specific line numbers and comparing formatted and unformatted files to do so is outside the scope of this plugin.
from formatter-maven-plugin.
I think you find a right direction: when making a comparison, generate a unified diff, which will include an indication where the diff starts and thus makes further analysis faster. Is it difficult to add this functionality?
Generate formatted diff output in Java
from formatter-maven-plugin.
@dmak It's not necessarily difficult. It's just a lot of extra code, and a lot to consider when trying to provide options to display the output. If we do this, then some people will want to suppress it, so we'll have to have options for doing that, and some people might want the files written but save the old files as backup, etc. Doing this just adds bloat, and possibly degrade performance.
Ultimately, none of it is necessary, since you can just run the formatter:format goal and see the diff yourself. If you're doing it in a GitHub Action, you can run formatter:validate as a goal, then conditionally on failure, run formatter:format and git diff. So, it's trivial to see the differences already without any changes in the plugin.
from formatter-maven-plugin.
Related Issues (20)
- NOTICE: Eclipse 2023-06 Requires jdk 17 for many parts HOT 7
- Eclipse Formatter Attribute Ignored: Parameter After Annotation HOT 1
- Sealed interfaces are not correctly formatted HOT 3
- Not able to run validate due to ExtensionRegistry return null value HOT 4
- False configuration used for line Indentation HOT 2
- lineEnding=KEEP breaks JSON validation on Windows HOT 6
- Tab treated as one space for the purpose of line length HOT 3
- Includes are not honored by includeResources
- Rewrite the cache store to match that done on impsort HOT 1
- Please use change log or github releases
- Support 'windows' users for contributions
- No documentation for 'find-transitive-eclipse-updates.sh' and it does not work on windows without additional software
- Next Release: placeholder to prevent release HOT 6
- Java 21 compliance HOT 1
- Incorrect documentation HOT 3
- Formatter no longer formats in version 2.24.0 HOT 10
- Integration Tests needed - Good for first time contributors
- NPE: Cannot invoke "org.eclipse.jdt.internal.compiler.ast.TypeReference.extraDimensions()" with version 2.24 HOT 1
- Allow 'validate' to write violations to a file, and not stop the build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formatter-maven-plugin.