question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ignoreErrorForPath does not work, perhaps related to build folder

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
nedtwiggcommented, Feb 10, 2019

Thanks very much for this issue, @thc202 and @magneticflux.

This does not seem to be a bug but a misconception on what ignoreErrorForPath is used to.

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, use targetExclude. I’m gonna close this out, please leave feedback in PR #353.

0reactions
nedtwiggcommented, Feb 12, 2019

Published in 3.18.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found