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

Refine checkstyle rules #6283

Merged
merged 4 commits into from
Apr 14, 2020
Merged

Refine checkstyle rules #6283

merged 4 commits into from
Apr 14, 2020

Conversation

koppor
Copy link
Member

@koppor koppor commented Apr 13, 2020

I was a bit annoyed that I had to comment on code style at code reviews. Bots should take care of this.

Formatting

} else if {

NOT

}
else if

Comments

// text

NOT

//text

Spacing

StandardField standardField = (StandardField) field;

NOT

StandardField standardField = (StandardField)field;

In other words

  • Add (and apply) checkstyle rules for
    • correct spacing (especalliy // space-after-comment-marker)
    • } else if { (<-- in one line)
    • no two empty lines
    • @Deprecation JavaDoc
    • some coding practices
  • Fix HTML syntax of JavaDoc comments
  • Remove CSS class comment syntax in IconTheme class
  • Remove deprecated method BibEntry#getCiteKey()

Could not fix all my issues (refs sevntu-checkstyle/sevntu.checkstyle#457), but I thought, I should push this intermediate result to move on and to reduce our reviewing load.

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

- Add (and apply) checkstyle rules for
  - correct spacing (especalliy // space-after-comment-marker)
  - } else if { (<-- in one line)
  - no two empty lines
  - @Deprecation JavaDoc
  - some coding practices
- Fix HTML syntax of JavaDoc comments
- Remove CSS class comment syntax in IconTheme class
- Remove deprecated method BibEntry#getCiteKey()
@@ -192,71 +192,71 @@ public static URL getIconUrl(String name) {
RANK3(MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR_OUTLINE, MaterialDesignIcon.STAR_OUTLINE),
RANK4(MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR_OUTLINE),
RANK5(MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR),
WWW(MaterialDesignIcon.WEB) /*css: web*/,
Copy link
Member

Choose a reason for hiding this comment

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

I fear removing this comments is a bad idea

Copy link
Member Author

Choose a reason for hiding this comment

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

The comments in this source file were the always (!) the same as the reference to the icon. I see no reason why we should duplicate constant names.

Copy link
Member Author

Choose a reason for hiding this comment

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

In case you can explain to me the sence of these comments, I can re-add them. All of them formatted the same way. I have the regexp ready.

I sat side-by-side by @matthiasgeiger when he worked on the icons at JabCon 2017. I think, they had to be used at that time when constants in the library were missing (and we had to adress the icon names by numbers (!)). Today, I see no reason to have them here.

@koppor koppor merged commit 940ef9d into master Apr 14, 2020
@koppor koppor deleted the checkstyle-comment branch April 14, 2020 06:49
@koppor koppor mentioned this pull request Apr 14, 2020
@koppor koppor mentioned this pull request May 8, 2020
@koppor koppor mentioned this pull request Apr 18, 2022
6 tasks
koppor pushed a commit that referenced this pull request Apr 15, 2023
4728902faa Create wiley-was.csl (#6283)
5853909f89 Create journal-of-human-nutrition-and-dietetics.csl (#6311)
286a3606c1 Create stanovnistvo.csl (#6431)
22a7139dc5 Update zitierguide-leitfaden-zum-fachgerechten-zitieren-in-rechtswiss… (#6489)
e51e9363ee Update netherlands-journal-of-geosciences-geologie-en-mijnbouw.csl (#6493)
4e1a69231c Add Bristol UP dependents (auto-generated) (#6494)
c9021437a4 Create microbiome-research-reports.csl (#6371)
f71e516dda Update harvard-anglia-ruskin-university.csl (#6365)
c187663e75 Create publicatiewijzer.csl (#6316)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 4728902faa1ef43c0d89366c77b7ea8f46c6730f
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.

2 participants