ignoreErrorForPath does not work, perhaps related to build folder
See original GitHub issueI have supplied a path src/main/org/x/y/z/ExcludedFile.java
to the ignoreErrorForPath
method and the file still causes the build to fail. I’ve tried both Unix and Windows style paths.
Spotless 3.8.0 Gradle 4.5 Eclipse formatter
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:17 (16 by maintainers)
Top Results From Across the Web
Android project not found. Maybe run react-native android first?
I solved my problem running this command before run-android ... and goto the project folder, run android(npx react-native run-android).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks very much for this issue, @thc202 and @magneticflux.
You are correct, and this misconception is so deep that I didn’t realize you were right until I finally sat down to try to actually fix the bug. I considered attempting to resolve this by making
ignoreErrorForPath
do the obvious behavior, which is to ignore formatting errors on that path, but that turned out to be quite hacky. “Which files to format” and “which internal errors to suppress” are different questions, and mushing them together was ugly.I think this whole issue is actually a symptom of our users didn’t have an easy way to exclude a file from formatting. We told people “if you want to ignore a folder, set target to be everything except that one file”. But that would be quite onerous for the examples given in this issue. I’m attempting to resolve this by adding a
targetExclude
parameter in PR #353.If you’ve got a file that you’d like to be formatted, but for whatever reason it sometimes causes the third-party formatter to throw exceptions and you don’t want them to block your build then use
ignoreErrorForPath
. If you don’t want the file to be formatted in the first place, usetargetExclude
. I’m gonna close this out, please leave feedback in PR #353.Published in 3.18.0.