dart icon indicating copy to clipboard operation
dart copied to clipboard

Suppress warnings in generated classes

Open Wavesonics opened this issue 8 years ago • 6 comments

It would be nice for those of us tha try to keep warnings at Zero, if the generated classes could suppress their unchecked cast warnings.

@SuppressWarnings("unchecked") on the whole class would probably be simplest.

Currently casting Serizlizables to parameterized ArrayList seems to be the biggest culprit for me. But it's probably any Serializable.

Wavesonics avatar Dec 30 '16 00:12 Wavesonics

@Adam, you can configure your quality tools to ignore the generated classes. That's generally a good practice.

We also happily accept PRs.

2016-12-30 1:12 GMT+01:00 Adam Brown [email protected]:

It would be nice for those of us tha try to keep warnings at Zero, if the generated classes could suppress their unchecked cast warnings.

@SuppressWarnings https://github.com/SuppressWarnings("unchecked") on the whole class would probably be simplest.

Currently casting Serizlizables to parameterized ArrayList seems to be the biggest culprit for me. But it's probably any Serializable.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/f2prateek/dart/issues/143, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33S5gQYQPNEaLMFxyVZX6lcjKxu72ks5rNExUgaJpZM4LX7SJ .

stephanenicolas avatar Dec 30 '16 06:12 stephanenicolas

@stephanenicolas I could be wrong (it's happened once before) but I don't think Android Studio/IntelliJ has a way to ignore warnings by file or directory.

However, I have a PR for you! https://github.com/f2prateek/dart/pull/145

Wavesonics avatar Jan 03 '17 21:01 Wavesonics

Thx @Wavesonics for the PR, but we need it to be green to make something out of it !

Also, I was talking about the quality tools you can automate as part of your builds like findbugs, pmd, checkstyle, not something you manually trigger in AS.

stephanenicolas avatar Jan 04 '17 04:01 stephanenicolas

@stephanenicolas btw, I sent a PR some time ago and it was red as well haha. But I have read the CI test report and the diff is just the order of generated methods in Henson class. (I mentioned it in the PR as well). This kind of failed really matters? Or could you allow us to improve the test cases as well?

Luolc avatar Jan 04 '17 04:01 Luolc

Yes it does matter, we only merge green PR. It is not only a good principle, it's also the only thing we can do via GH...

2017-01-04 5:25 GMT+01:00 LoLo [email protected]:

@stephanenicolas https://github.com/stephanenicolas btw, I sent a PR some time ago and it was red as well haha. But I have read the CI test report and the diff is just the order of generated methods in Henson class. (I mentioned it in the PR as well). This kind of failed really matters? Or could you allow us to improve the test cases as well?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/f2prateek/dart/issues/143#issuecomment-270292312, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33VSxqWmeTUjW_uRNjUwPDyxsefmJks5rOx9MgaJpZM4LX7SJ .

stephanenicolas avatar Jan 04 '17 04:01 stephanenicolas

@stephanenicolas Ya I know the TDD principle, but what I am confused is that I need to add some codes not really elegant if I want to make the CI test green(in my case, I could simply sort the method to suit the test but it is kind of ugly :( So is it a good practice to do so? I am new to open source group and not very familiar with the rules of PR. If the answer is yes, I will update my PR later :)

Luolc avatar Jan 04 '17 04:01 Luolc