Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumberFormatException at Flake8 parser #69

Closed
henriquetruta opened this issue Jun 3, 2019 · 4 comments
Closed

NumberFormatException at Flake8 parser #69

henriquetruta opened this issue Jun 3, 2019 · 4 comments

Comments

@henriquetruta
Copy link

I'm getting an error on the Flake8 parser on this log: flake8-failure.log

java.lang.NumberFormatException: null
	at java.base/java.lang.Integer.parseInt(Integer.java:614)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at se.bjurr.violations.lib.parsers.Flake8Parser.parseReportOutput(Flake8Parser.java:32)
	at com.spotify.dredd.judges.Flake8Judge.judge(Flake8Judge.java:38)
	at CheckstyleJudgeTest.flake8Error(CheckstyleJudgeTest.java:39)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

It seems like the last line is causing it. When I remove it I see a lot of non-flake8 violations being reported, such as this screenshot:
dredd____git_pipedream_dredd__-____src_main_java_com_spotify_dredd_judges_Flake8Judge_java__dredd

@tomasbjerre
Copy link
Owner

Not sure if I want to support this. There are a lot of irrelevant lines in that report file. Any attempt at supporting this might make the code more complex and I'm not even sure it would be possible to support cases with this much noise.

Did you have a look at the examples here? https://github.com/tomasbjerre/violations-lib/tree/master/src/test/resources/flake8

@henriquetruta
Copy link
Author

Yeah, I saw it. And I understand your point. I can live with the false positives. Do you think it makes sense to at least add some logic so it doesn't crash in such cases?

tomasbjerre added a commit that referenced this issue Jun 7, 2019
@tomasbjerre
Copy link
Owner

Released 1.93 now that will allow not fail. But will contain a lot of noise. If this causes other bugs in the future, it might be reverted... so still I would strongly recommend to keep the report file clean.

You are just using the library right? I did not release any plugins now.

@henriquetruta
Copy link
Author

henriquetruta commented Jun 7, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants