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

Check Integrity year check added #1906

Merged
merged 9 commits into from
Sep 2, 2016
Merged

Check Integrity year check added #1906

merged 9 commits into from
Sep 2, 2016

Conversation

grimes2
Copy link
Contributor

@grimes2 grimes2 commented Sep 1, 2016

#1897 Added last four nonpunctuation characters should be numerals in Check Integrity year

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef

@grimes2 grimes2 changed the title Alpha Check Integrity year check added Sep 1, 2016
@oscargus
Copy link
Contributor

oscargus commented Sep 1, 2016

Thanks! The tests fails because of missing translation strings.

If you run the logic/i10/LocalizationConsistencyTest.java you will get a list of strings which are not in the translation files. Add those to the English one and run the script that the output tells you to. Then, all languages are updated and the test should pass (you may have to refresh the files in your IDE in case it fails again). Also, see: https://github.com/JabRef/jabref/wiki/Code-Howtos#using-localization-correctly

If you can add a test to IntegrityCheckTest (or whatever it is called) that really tests for this new feature it would be great.

@grimes2
Copy link
Contributor Author

grimes2 commented Sep 1, 2016

I hope, it is correct now. Please set label "ready-for-review". Thanks.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Sep 1, 2016
@@ -16,6 +16,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- [#1496](https://github.com/JabRef/jabref/issues/1496) Keep track of which entry a downloaded file belongs to
- Made it possible to download multiple entries in one action
- [#1813](https://github.com/JabRef/jabref/issues/1813) Import/Export preferences dialog default directory set to working directory
- [#1897](https://github.com/JabRef/jabref/issues/1897) Added last four nonpunctuation characters should be numerals in Check Integrity year
Copy link
Member

Choose a reason for hiding this comment

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

I would reword it a bit to make it a a bit more clear:

Implemented integrity check for year field: Last four nonpunctuation characters should be numerals

(Put the word "year" in backticks (the french accent grave), just look at other examples in the changelog)

@Siedlerchr
Copy link
Member

Thanks for your work 👍 LGTM!
If you reword the changelog, we can merge it in.

@@ -321,6 +323,12 @@ private BracketChecker(String field) {
return Collections.singletonList(new IntegrityMessage(Localization.lang("should contain a four digit number"), entry, FieldName.YEAR));
}

Copy link
Member

@stefan-kolb stefan-kolb Sep 1, 2016

Choose a reason for hiding this comment

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

We should add a comment to the BibTeX doc here, because this decision on year structure is not intuitive.

@tobiasdiez
Copy link
Member

tobiasdiez commented Sep 1, 2016

A probably stupid question: why not just check that the year field consists exactly of 4 digits?

@Siedlerchr
Copy link
Member

@tobiasdiez Because the offical bibtex spec says so:
See the issue for details:
#1897 (comment)

.asPredicate();
private static final String regex = "[](){},.;!?<>%&$]";
Copy link
Member

Choose a reason for hiding this comment

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

Please uppercase constant name and call it something like PUNCTUATION_MARKS. Just calling it regex doesn't really help in understanding what it's for.

@stefan-kolb
Copy link
Member

Got 3 minor comments and then we can merge 👍

assertWrong(createContext("year", "abc"));
assertWrong(createContext("year", "86"));
assertWrong(createContext("year", "204"));
assertWrong(createContext("year", "1986a"));
Copy link
Member

Choose a reason for hiding this comment

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

Please add also a test case with one of the regex symbols

@stefan-kolb
Copy link
Member

Thanks 😄 LGTM 👍

@Siedlerchr
Copy link
Member

LGTM, too.

@stefan-kolb stefan-kolb merged commit d071718 into JabRef:master Sep 2, 2016
@grimes2 grimes2 deleted the alpha branch September 14, 2016 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants