onvif icon indicating copy to clipboard operation
onvif copied to clipboard

Add checkstyle to the java code

Open fpompermaier opened this issue 5 years ago • 5 comments

Add a checkstyle to the project

fpompermaier avatar Jul 30 '19 07:07 fpompermaier

Do you have a style format you like? sun vs. google? tabs vs. spaces? I don't care much-- but code with tabs.. but don't mind running Code-Format for all source files from intellij.

BTW, I'm running FindBugs on the code and fixing a few of the warnings.

Bhlowe avatar Jul 30 '19 18:07 Bhlowe

I think we just need to choose one. I'd go with google just because it has the largest width (100) and it's very easy to set up. Then we could set up also a Travis job to verify the PRs

fpompermaier avatar Jul 31 '19 07:07 fpompermaier

Google is fine. Made a PR but not sure exactly how checkstyle works. Checkstyle now builds a report when you run maven site.. but I did not bother to correct all of the warnings.

Also, I think checkstyle/code formatting should ignore or not modify the generated source code. Or at least not require a "format source" on generated code to match what is in the repository. Perhaps a "generated source" folder is a good idea.

Noticed on one camera that getting the list of audioSources fails if a camera doesn't support audio by throwing a soapfaultexception. Not sure how to avoid without wrapping the call with a catch throwable. Is there a check to see if audio is supported? Not very important, but want the "checkDevice" test to complete if the url, user and pass are correct.

Bhlowe avatar Jul 31 '19 18:07 Bhlowe

Merged the PR but we still needs to exclude generated code from checks and fix the distributionManagmenet in the pom.xml so I keep this issue open just as a reminder

fpompermaier avatar Aug 03 '19 08:08 fpompermaier

Sounds good. I've been busy on other projects.. but using this internally in my software. Thanks!

Bhlowe avatar Aug 15 '19 17:08 Bhlowe