vivo-project / VIVO

VIVO is an extensible semantic web application for research discovery and showcasing scholarly work
http://vivoweb.org
BSD 3-Clause "New" or "Revised" License
205 stars 127 forks source link

Codestyle #3840

Closed chenejac closed 11 months ago

chenejac commented 1 year ago

VIVO GitHub issue: 3814

Linked Vitro PR

What does this pull request do?

Adding code style into the VIVO/Vitro project

What's new?

checkstyle.xml added into the Vitro root checkstyle-suppression.xml added in the Vitro root (empty at the moment) A wiki page added - https://wiki.lyrasis.org/display/VIVO/Code+Style+Guide checkstyle.xml file linked in pom.xml file (at the moment configured to be skipped)

How should this be tested?

Just for reviewing purposes there is commit with code formatted by using this code style at https://github.com/chenejac/VIVO/commit/863801995c1bcc9ed6685047d17db1c3e88f16e1 Checking style is turned off by definition of suppressions at the level of a Java file:

  1. cd VIVO
  2. mvn checkstyle:checkstyle
  3. No code style violations reported
  4. open checkstyle_suppressions.xml and delete line 6 <suppress files="src[\\/]main[\\/]java[\\/]edu[\\/]cornell[\\/]mannlib[\\/]semservices[\\/]service[\\/]impl[\\/]AgrovocService\.java" checks="."/>
  5. mvn checkstyle:checkstyle
  6. Hundreds of code style violations reported

Interested parties

Tag (@ mention) interested parties or, if unsure, @VIVO-project/vivo-committers

chenejac commented 1 year ago

Should VIVO have its own checkstyles? Using Vitro from a sibling directory is not desirable.

I suppose there is no any sense in making different style rules for Vitro and VIVO, but we might also copy the same checkstyle.xml from Vitro to VIVO. @wwelling the practice that Vitro and VIVO projects have to be in sibling directories will be changed in your PRs for improving build process?

ghost commented 1 year ago

@chenejac no that does not change in the build/deploy decoupling effort. However, we should try, if possible, to not further the coupling.

Isn't it possible to build VIVO without Vitro as a sibling directory as long as you do not require any custom changes or specific unpublished Vitro artifact?

chenejac commented 1 year ago

Isn't it possible to build VIVO without Vitro as a sibling directory as long as you do not require any custom changes or specific unpublished Vitro artifact?

Yes, you are right. I have copied checkstyle.xml and checkstyle-suppressions.xml to root of the VIVO project and fixed links in pom.xml file.