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

Codestyle #3840

Merged
merged 8 commits into from Sep 14, 2023
Merged

Codestyle #3840

merged 8 commits into from Sep 14, 2023

Conversation

chenejac
Copy link
Contributor

@chenejac chenejac commented Feb 24, 2023

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 chenejac@8638019
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

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@chenejac chenejac linked an issue Feb 28, 2023 that may be closed by this pull request
@chenejac
Copy link
Contributor Author

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
Copy link

ghost commented Feb 28, 2023

@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
Copy link
Contributor Author

chenejac commented Mar 1, 2023

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.

ghost
ghost previously approved these changes Mar 1, 2023
@chenejac chenejac requested a review from a user March 7, 2023 08:29
ghost
ghost previously approved these changes Mar 7, 2023
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignoring comment cleanup as missed last review. ;)

litvinovg
litvinovg previously approved these changes Mar 7, 2023
@chenejac chenejac linked an issue Jun 15, 2023 that may be closed by this pull request
@chenejac chenejac removed a link to an issue Jun 15, 2023
@chenejac chenejac dismissed stale reviews from litvinovg and ghost via cce94d5 June 16, 2023 07:56
Copy link
Collaborator

@litvinovg litvinovg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's increase character limit to 120as we discussed in committers call some time ago.

checkstyle.xml Outdated Show resolved Hide resolved
checkstyle.xml Outdated Show resolved Hide resolved
checkstyle.xml Outdated Show resolved Hide resolved
@chenejac chenejac requested a review from litvinovg June 28, 2023 09:06
litvinovg
litvinovg previously approved these changes Jun 28, 2023
@chenejac chenejac merged commit cd20055 into vivo-project:main Sep 14, 2023
4 checks passed
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

Successfully merging this pull request may close these issues.

Definition of the code style
3 participants