diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5ce48160d2e..6151358ef2f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,6 +12,7 @@ The title of the PR must not reference an issue, because GitHub does not support --> ### Mandatory checks + - [ ] Change in `CHANGELOG.md` described in a way that is understandable for the average user (if applicable) - [ ] Tests created for changes (if applicable) - [ ] Manually tested changed features in running JabRef (always required) diff --git a/.github/failure-csl-update.md b/.github/failure-csl-update.md deleted file mode 100644 index 0b9ab11c20f..00000000000 --- a/.github/failure-csl-update.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Error while updating citation styles -labels: code-quality, dependencies ---- -[Update of citation styles failed!](https://github.com/JabRef/jabref/actions?query=workflow%3A%22Refresh+Citation+Style+Language+Files%22) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index faafc44280b..5ec087a8e62 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,6 +21,9 @@ concurrency: group: tests-${{ github.head_ref }} cancel-in-progress: true +permissions: + pull-requests: write + jobs: checkstyle: name: Checkstyle @@ -123,7 +126,7 @@ jobs: You can check the detailed error output at the tab "Checks", section "Tests" (on the left), subsection "Modernizer". comment_tag: modernizer - markdown-checks: + markdown: name: Markdown runs-on: ubuntu-latest steps: @@ -132,11 +135,23 @@ jobs: with: submodules: 'false' show-progress: 'false' - - name: Run markdown-lint - uses: avto-dev/markdown-lint@v1 + - name: markdownlint-cli2-action + uses: DavidAnson/markdownlint-cli2-action@v9 with: - args: CHANGELOG.md CONTRIBUTING.md README.md - config: '.markdownlint.yml' + globs: | + *.md + docs/**/*.md + - name: Add comment on pull request + if: ${{ failure() }} + uses: thollander/actions-comment-pull-request@v2 + with: + message: > + You modified Markdown (*.md) files. + To ensure consistent styling, we have [markdown-lint](https://github.com/DavidAnson/markdownlint) in place. + [Markdown lint's rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#rules) help to keep our Markdown files consistent within this repository and consistent with the Markdown files outside here. + + You can check the detailed error output at the tab "Checks", section "Tests" (on the left), subsection "Markdown". + comment_tag: markdown changelog-non-frozen: name: CHANGELOG.md runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 9205cd4ab87..041b6581347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1190,4 +1190,4 @@ The changelog of JabRef 2.11 and all previous versions is available as [text fil [5.0]: https://github.com/JabRef/jabref/compare/v5.0-beta...v5.0 [5.0-beta]: https://github.com/JabRef/jabref/compare/v5.0-alpha...v5.0-beta [5.0-alpha]: https://github.com/JabRef/jabref/compare/v4.3...v5.0-alpha - + diff --git a/LICENSE.md b/LICENSE similarity index 91% rename from LICENSE.md rename to LICENSE index 410b297cab4..37471bcae7e 100644 --- a/LICENSE.md +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright © 2003-2023 [JabRef Authors](https://github.com/JabRef/jabref/blob/master/AUTHORS) +Copyright © 2003-2023 JabRef Authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/PRIVACY.md b/PRIVACY.md index f5552fed91b..d7a1ca68b48 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -111,10 +111,12 @@ This privacy policy is in effect as of the day mentioned as "last updated" above ## Contact -If you get in touch with us, we may aks you to provide us with certain personal information (e.g. name and email address) to stay in contact with you. +If you get in touch with us, we may ask you to provide us with certain personal information (e.g. name and email address) to stay in contact with you. For any questions or concerns regarding the privacy policy, please send us an email to or write to JabRef e.V. Josef-Lanner-Str. 9 71069 Sindelfingen Germany + + diff --git a/README.md b/README.md index f8e65405ad6..3583f748fbf 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,5 @@ For IntelliJ IDEA, just import the project via a Gradle Import by pointing at th ## Sponsoring -JabRef development is powered by YourKit Java Profiler [![YourKit Java Profiler](https://www.yourkit.com/images/yk_logo.svg)](https://www.yourkit.com/java/profiler/) - -[JabRef]: https://www.jabref.org +JabRef development is powered by YourKit Java Profiler +[![YourKit Java Profiler](https://www.yourkit.com/images/yk_logo.svg)](https://www.yourkit.com/java/profiler/) diff --git a/docs/README.md b/docs/README.md index fad376b6982..18c6f411667 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,7 +9,7 @@ Installing the latest version of ruby followed by `gem install bundler` should b Afterwards, run -```terminal +```shell bundle install jekyll serve --livereload ``` @@ -18,7 +18,7 @@ and go to in your browser. On **Windows**, using a dockerized environment is recommended: -```terminal +```shell docker build . -t jrjekyll docker run -p 4000:4000 -it --rm --volume="C:\git-repositories\jabref\docs":/srv/jekyll jrjekyll jekyll serve -H 0.0.0.0 -t ``` @@ -27,3 +27,13 @@ docker run -p 4000:4000 -it --rm --volume="C:\git-repositories\jabref\docs":/srv * In case you get errors regarding `Gemfile.lock`, just delete `Gemfile.lock` and rerun. * The current `Dockerfile` is based on . The [Jekyll Docker image](https://github.com/envygeeks/jekyll-docker#jekyll-docker) did not work end of 2022 (because Ruby was too new). + +## Execute linting action + +You can execute the linting action as if it was executed by GitHub by executing following command. + +```shell +act --rm --platform ubuntu-latest=fwilhe2/act-runner:latest -W .github/workflows/tests.yml -j "markdown" +``` + +That command uses [act](https://github.com/nektos/act), which brings GitHub actions execution to the developer machine. diff --git a/docs/code-howtos/error-handling.md b/docs/code-howtos/error-handling.md index 233ebd10d1c..562a74e8039 100644 --- a/docs/code-howtos/error-handling.md +++ b/docs/code-howtos/error-handling.md @@ -9,16 +9,17 @@ Principles: * All exceptions we throw should be or extend `JabRefException`; This is especially important if the message stored in the Exception should be shown to the user. `JabRefException` has already implemented the `getLocalizedMessage()` method which should be used for such cases (see details below!). * Catch and wrap all API exceptions (such as `IOExceptions`) and rethrow them - * Example: - - ```java - try { - // ... - } catch (IOException ioe) { - throw new JabRefException("Something went wrong...", - Localization.lang("Something went wrong...", ioe); - } - ``` + * Example: + + ```java + try { + // ... + } catch (IOException ioe) { + throw new JabRefException("Something went wrong...", + Localization.lang("Something went wrong...", ioe); + } + ``` + * Never, ever throw and catch `Exception` or `Throwable` * Errors should only be logged when they are finally caught (i.e., logged only once). See **Logging** for details. * If the Exception message is intended to be shown to the User in the UI (see below) provide also a localizedMessage (see `JabRefException`). @@ -34,6 +35,6 @@ To show error message two different ways are usually used in JabRef: * showing an error dialog * updating the status bar at the bottom of the main window -``` -TODO: Usage of status bar and Swing Dialogs +```text +TODO: Usage of status bar and `DialogService` ``` diff --git a/docs/code-howtos/http-server.md b/docs/code-howtos/http-server.md index 0652cbe70c0..309c3eeb30f 100644 --- a/docs/code-howtos/http-server.md +++ b/docs/code-howtos/http-server.md @@ -17,7 +17,9 @@ Howto for Windows - other operating systems work similar: Note: If you do not do this, you get following error message: - Could not find server key store C:\Users\USERNAME\AppData\Local\org.jabref\jabref\ssl\server.p12. +```text +Could not find server key store C:\Users\USERNAME\AppData\Local\org.jabref\jabref\ssl\server.p12. +``` ## Start http server @@ -33,13 +35,15 @@ Does not work. Current try: - ./gradlew run -Pcomment=httpserver +```shell +./gradlew run -Pcomment=httpserver +``` -However, there are with `ForkJoin` (discussion at https://discuss.gradle.org/t/is-it-ok-to-use-collection-parallelstream-or-other-potentially-multi-threaded-code-within-gradle-plugin-code/28003) +However, there are with `ForkJoin` (discussion at ) Gradle output: -``` +```shell > Task :run 2023-04-22 11:30:59 [main] org.jabref.http.server.Server.main() DEBUG: Libraries served: [C:\git-repositories\jabref-all\jabref\src\main\resources\org\jabref\http\server\http-server-demo.bib] @@ -51,7 +55,7 @@ DEBUG: Starting server... IntelliJ output, if `org.jabref.http.server.Server#main` is executed: -``` +```shell DEBUG: Starting server... 2023-04-22 11:44:59 [ForkJoinPool.commonPool-worker-1] org.glassfish.grizzly.http.server.NetworkListener.start() INFO: Started listener bound to [localhost:6051] diff --git a/docs/code-howtos/index.md b/docs/code-howtos/index.md index 94ca60ff51a..fff2c645b44 100644 --- a/docs/code-howtos/index.md +++ b/docs/code-howtos/index.md @@ -64,25 +64,26 @@ Global variables should be avoided. Try to pass them as dependency. ### keywords sync -Database.addDatabaseChangeListener does not work as the DatabaseChangedEvent does not provide the field information. Therefore, we have to use BibtexEntry.addPropertyChangeListener(VetoableChangeListener listener) +`Database.addDatabaseChangeListener` does not work as the `DatabaseChangedEvent` does not provide the field information. +Therefore, we have to use `BibtexEntry.addPropertyChangeListener(VetoableChangeListener listener)`. ## Working with BibTeX data ### Working with authors -You can normalize the authors using `org.jabref.model.entry.AuthorList.fixAuthor_firstNameFirst(String)`. Then the authors always look nice. The only alternative containing all data of the names is `org.jabref.model.entry.AuthorList.fixAuthor_lastNameFirst(String)`. The other `fix...` methods omit data (like the von parts or the junior information). +You can normalize the authors using `org.jabref.model.entry.AuthorList.fixAuthor_firstNameFirst(String)`. Then the authors always look nice. The only alternative containing all data of the names is `org.jabref.model.entry.AuthorList.fixAuthor_lastNameFirst(String)`. The other `fix...` methods omit data (like the "von" parts or the junior information). ## Benchmarks * Benchmarks can be executed by running the `jmh` gradle task (this functionality uses the [JMH Gradle plugin](https://github.com/melix/jmh-gradle-plugin)) * Best practices: - * Read test input from `@State` objects - * Return result of calculations (either explicitly or via a `BlackHole` object) + * Read test input from `@State` objects + * Return result of calculations (either explicitly or via a `BlackHole` object) * [List of examples](https://github.com/melix/jmh-gradle-example/tree/master/src/jmh/java/org/openjdk/jmh/samples) ## Measure performance -Try out the [YourKit JAva Profiler](https://www.yourkit.com). +Try out the [YourKit Java Profiler](https://www.yourkit.com). ## equals @@ -92,7 +93,7 @@ When creating an `equals` method follow: 2. Use the `instanceof` operator to check if the argument has the correct type. If not, return `false`. 3. Cast the argument to the correct type. 4. For each “significant” field in the class, check if that field of the argument matches the corresponding field of this object. If all these tests succeed, return `true` otherwise, return `false`. -5. When you are finished writing your equals method, ask yourself three questions: Is it symmetric? Is it transitive? Is it consistent? +5. When you are finished writing your `equals` method, ask yourself three questions: Is it symmetric? Is it transitive? Is it consistent? Also, note: @@ -103,4 +104,3 @@ Also, note: ## Files and Paths Always try to use the methods from the nio-package. For interoperability, they provide methods to convert between file and path. [https://docs.oracle.com/javase/tutorial/essential/io/path.html](https://docs.oracle.com/javase/tutorial/essential/io/path.html) Mapping between old methods and new methods [https://docs.oracle.com/javase/tutorial/essential/io/legacy.html#mapping](https://docs.oracle.com/javase/tutorial/essential/io/legacy.html#mapping) - diff --git a/docs/code-howtos/javafx.md b/docs/code-howtos/javafx.md index c5faee31d74..c045b12fc12 100644 --- a/docs/code-howtos/javafx.md +++ b/docs/code-howtos/javafx.md @@ -128,7 +128,7 @@ public class AboutDialogView extends BaseDialog @Inject private DialogService dialogService; ``` -* It is convenient to load the FXML-view directly from the controller class. +* It is convenient to load the FXML-view directly from the controller class. The FXML file is loaded using `ViewLoader` based on the name of the class passed to `view`. To make this convention-over-configuration approach work, both the FXML file and the View class should have the same name and should be located in the same package. diff --git a/docs/code-howtos/jpackage.md b/docs/code-howtos/jpackage.md index 669ce1f3242..74c10a524fd 100644 --- a/docs/code-howtos/jpackage.md +++ b/docs/code-howtos/jpackage.md @@ -28,11 +28,12 @@ Sometimes issues with modularity only arise in the installed version and do not 1. Open `build.gradle`, under jlink options remove `--strip-debug` 2. Build using `jpackageImage` (or let the CI build a new version) -3. Modify the `build\image\JabRef\runtime\bin\Jabref.bat` file, replace the last line with +3. Modify the `build\image\JabRef\runtime\bin\Jabref.bat` file, replace the last line with - ``` + ```shell pushd %DIR% & %JAVA_EXEC% -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -p "%~dp0/../app" -m org.jabref/org.jabref.cli.Launcher %* & popd ``` + 4. Open your IDE and add a "Remote Debugging Configuration" for `localhost:8000` 5. Start JabRef by running the above bat file 6. Connect with your IDE using remote debugging diff --git a/docs/code-howtos/localization.md b/docs/code-howtos/localization.md index c9072e21494..f2da0d5950e 100644 --- a/docs/code-howtos/localization.md +++ b/docs/code-howtos/localization.md @@ -35,9 +35,7 @@ General hints: The tests check whether translation strings appear correctly in the resource bundles. -1. Add new `Localization.lang("KEY")` to Java file. Run the `LocalizationConsistencyTest`under (src/test/org.jabref.logic. - - ) +1. Add new `Localization.lang("KEY")` to Java file. Run the `org.jabref.logic.LocalizationConsistencyTest`. 2. Tests fail. In the test output a snippet is generated which must be added to the English translation file. 3. Add snippet to English translation file located at `src/main/resources/l10n/JabRef_en.properties` 4. Please do not add translations for other languages directly in the properties. They will be overwritten by [Crowdin](https://crowdin.com/project/jabref) diff --git a/docs/code-howtos/logging.md b/docs/code-howtos/logging.md index 09b252b525e..4503d0731fb 100644 --- a/docs/code-howtos/logging.md +++ b/docs/code-howtos/logging.md @@ -43,6 +43,5 @@ In the `.properties` file, this is done for `org.jabref.model.entry.BibEntry`. ## Further reading -SLF4J also support parameterized logging, e.g. if you want to print out multiple arguments in a log statement use a pair of curly braces (`{}`). +SLF4J also support parameterized logging, e.g. if you want to print out multiple arguments in a log statement use a pair of curly braces (`{}`). Head to for examples. - diff --git a/docs/code-howtos/openoffice/ooresult-ooerror/index.md b/docs/code-howtos/openoffice/ooresult-ooerror/index.md index 3260928b9b3..fd43f56efb1 100644 --- a/docs/code-howtos/openoffice/ooresult-ooerror/index.md +++ b/docs/code-howtos/openoffice/ooresult-ooerror/index.md @@ -99,7 +99,7 @@ with an assumption that at any time exactly one of `result` and `error` is prese * Since `OOResult` encodes the state `isOK` in `result.isPresent()` (and equivalently in `errror.isEmpty()`), we cannot allow construction of instances where both values are `isEmpty`.\ In particular, `OOResult.ok(null)` and `OOResult.error(null)` are not allowed: it would make the state `isOK` ambiguous.\ It would also break the similarity to `Optional` to allow both `isEmpty` and `isOK` to be true. -* Not allowing null, has a consequence on `OOResult`\ +* Not allowing null, has a consequence on `OOResult`\ According to [baeldung.com/java-void-type](https://www.baeldung.com/java-void-type), the only possible value for `Void` is `null` which we excluded. `OOResult.ok(null)` would look strange: in this case we need `ok()` without arguments. diff --git a/docs/code-howtos/openoffice/overview.md b/docs/code-howtos/openoffice/overview.md index 56ec4d857ce..a76ece7bb3a 100644 --- a/docs/code-howtos/openoffice/overview.md +++ b/docs/code-howtos/openoffice/overview.md @@ -65,7 +65,7 @@ A group of parenthesized citations share the parentheses around, like this:\ From the user's point of view, citation groups can be created by -1. Selecting multiple entries in a bibliography database, then +1. Selecting multiple entries in a bibliography database, then * `[click:Cite]` or * `[click:Cite in-text]` or @@ -140,8 +140,8 @@ The order of appearance of citations (as considered during numbering and adding The order of citations within a citation group is controlled by `jstyle:MultiCiteChronological`. -* true asks for (year, author, title) ordering, -* false for (author, year, title). +* `true` asks for (year, author, title) ordering, +* `false` for (author, year, title). * (There is no option for "in the order provided by the user"). For author-year citation styles this ordering is used directly. @@ -159,21 +159,21 @@ The location of each citation group in the document is provided by the user. In #### Order of the citations * `globalOrder` and `localOrder` together provide the order of appearance of citations -* This also provides the order of first appearance of the cited sources. +* This also provides the order of first appearance of the cited sources. - First appearance order of sources is used + First appearance order of sources is used - * in `jstyle:IsSortByPosition` numbered styles - * in author-year styles: first appearance of "Smith200a" should precede that of "Smith200b".\ - To achieve this, the sources get the letters according the order of their first appearance. - * This seems to contradict the statement "The bibliography is sorted in (author, year, title) order" above.\ - It does not. As of JabRef 5.3 both are true.\ - Consequence: in the references Smith2000b may precede Smith2000a. ([reported](https://github.com/JabRef/jabref/issues/7805)) - * Some author-year citation styles prescribe a higher threshold on the number of authors for switching to "FirstAuthor et al." form (`jstyle:MaxAuthors`) at the first citation of a source (`jstyle:MaxAuthorsFirst`) + * in `jstyle:IsSortByPosition` numbered styles + * in author-year styles: first appearance of "Smith200a" should precede that of "Smith200b".\ + To achieve this, the sources get the letters according the order of their first appearance. + * This seems to contradict the statement "The bibliography is sorted in (author, year, title) order" above.\ + It does not. As of JabRef 5.3 both are true.\ + Consequence: in the references Smith2000b may precede Smith2000a. ([reported](https://github.com/JabRef/jabref/issues/7805)) + * Some author-year citation styles prescribe a higher threshold on the number of authors for switching to "FirstAuthor et al." form (`jstyle:MaxAuthors`) at the first citation of a source (`jstyle:MaxAuthorsFirst`) ## What is stored in a document (JabRef5.2) -* Each group of citations has a reference mark. +* Each group of citations has a reference mark. (Reference marks are shown in LibreOffice in Navigator, under "References".\ To show the Navigator: `LibreOffice:[menu:View]/[Navigator]` or `LibreOffice:[key:F5]`) diff --git a/docs/code-howtos/openoffice/problems.md b/docs/code-howtos/openoffice/problems.md index 4d11dc62966..ee371a72d36 100644 --- a/docs/code-howtos/openoffice/problems.md +++ b/docs/code-howtos/openoffice/problems.md @@ -11,22 +11,22 @@ grand_parent: Code Howtos a `(problem)`: pageInfo strings are conceptually associated with citations, but the implementation associates them to citation groups.\ The number of available pageInfo slots changes during`[click:Merge]` and `[click:Separate]` while the number of citations remains fixed. * The proposed solution was to change the association. - * Not only reference marks (citation groups) need unique identifiers, but also citations.\ - Possible encoding for reference mark names:\ - `JR_cite{type}_{number1}_{citationKey1},{number2}_{citationKey2}`\ - where `{type}` encodes the citation type (for the group), `{citationKey1}` is made unique by choosing an appropriate number for `{number1}`\ - This would allow `JR_cite_{number1}_{citationKey1}` to be used as a property name for storing the pageInfo. + * Not only reference marks (citation groups) need unique identifiers, but also citations.\ + Possible encoding for reference mark names:\ + `JR_cite{type}_{number1}_{citationKey1},{number2}_{citationKey2}`\ + where `{type}` encodes the citation type (for the group), `{citationKey1}` is made unique by choosing an appropriate number for `{number1}`\ + This would allow `JR_cite_{number1}_{citationKey1}` to be used as a property name for storing the pageInfo. - Changes required to + Changes required to - * reference mark search, name generation and parsing - * name generation and parsing for properties storing pageInfo values - * in-memory representation - * JabRef 5.2 does not collect pageInfo values, accesses only when needed.\ - So it would be change to code accessing them. - * The proposed representation does collect, to allow separation of getting from the document and processing - * insertion of pageInfo into citation markers: JabRef 5.2 injects a single pageInfo before the closing parenthesis, now we need to handle several values - * `[click:Manage citations]` should work on citations, not citation groups. + * reference mark search, name generation and parsing + * name generation and parsing for properties storing pageInfo values + * in-memory representation + * JabRef 5.2 does not collect pageInfo values, accesses only when needed.\ + So it would be change to code accessing them. + * The proposed representation does collect, to allow separation of getting from the document and processing + * insertion of pageInfo into citation markers: JabRef 5.2 injects a single pageInfo before the closing parenthesis, now we need to handle several values + * `[click:Manage citations]` should work on citations, not citation groups. ## Backend diff --git a/docs/code-howtos/testing.md b/docs/code-howtos/testing.md index 3a4831353a4..bd882884954 100644 --- a/docs/code-howtos/testing.md +++ b/docs/code-howtos/testing.md @@ -24,7 +24,7 @@ Imagine you want to test the method `format(String value)` in the class `BracesF * _Placing:_ all tests should be placed in a class named `classTest`, e.g. `BracesFormatterTest`. * _Naming:_ the name should be descriptive enough to describe the whole test. Use the format `methodUnderTest_ expectedBehavior_context` (without the dashes). So for example `formatRemovesDoubleBracesAtBeginning`. Try to avoid naming the tests with a `test` prefix since this information is already contained in the class name. Moreover, starting the name with `test` leads often to inferior test names (see also the [Stackoverflow discussion about naming](http://stackoverflow.com/questions/155436/unit-test-naming-best-practices)). -* _Test only one thing per test:_ tests should be short and test only one small part of the method. So instead of +* _Test only one thing per test:_ tests should be short and test only one small part of the method. So instead of ```java testFormat() { @@ -36,14 +36,14 @@ Imagine you want to test the method `format(String value)` in the class `BracesF we would have five tests containing a single `assert` statement and named accordingly (`formatDoesNotChangeStringWithoutBraces`, `formatDoesNotRemoveSingleBrace`, , etc.). See [JUnit AntiPattern](https://exubero.com/junit/anti-patterns/#Multiple\_Assertions) for background. * Do _not just test happy paths_, but also wrong/weird input. -* It is recommend to write tests _before_ you actually implement the functionality (test driven development). +* It is recommended to write tests _before_ you actually implement the functionality (test driven development). * _Bug fixing:_ write a test case covering the bug and then fix it, leaving the test as a security that the bug will never reappear. * Do not catch exceptions in tests, instead use the `assertThrows(Exception.class, ()->doSomethingThrowsEx())` feature of [junit-jupiter](https://junit.org/junit5/docs/current/user-guide/) to the test method. ## Lists in tests * Use `assertEquals(Collections.emptyList(), actualList);` instead of `assertEquals(0, actualList.size());` to test whether a list is empty. -* Similarly, use `assertEquals(Arrays.asList("a", "b"), actualList);` to compare lists instead of +* Similarly, use `assertEquals(Arrays.asList("a", "b"), actualList);` to compare lists instead of ```java assertEquals(2, actualList.size()); @@ -57,7 +57,7 @@ Imagine you want to test the method `format(String value)` in the class `BracesF ## Files and folders in tests -* If you need a temporary file in tests, then add the following Annotation before the class: +* If you need a temporary file in tests, then add the following Annotation before the class: ```java @ExtendWith(TempDirectory.class) @@ -112,7 +112,7 @@ To test that a preferences migration works successfully, use the mockito method To quickly host a local PostgreSQL database, execute following statement: -``` +```shell docker run -d -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres -p 5432:5432 --name db postgres:10 postgres -c log_statement=all ``` @@ -124,7 +124,7 @@ Then, all DBMS Tests (annotated with `@org.jabref.testutils.category.DatabaseTes A MySQL DBMS can be started using following command: -``` +```shell docker run -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=jabref -p 3800:3307 mysql:8.0 --port=3307 ``` diff --git a/docs/contributing.md b/docs/contributing.md index 3d010158623..b21775d69bf 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -65,7 +65,7 @@ Add new `Localization.lang("KEY")` to a Java file. The tests will fail. In the t Example: -``` +```text java.lang.AssertionError: DETECTED LANGUAGE KEYS WHICH ARE NOT IN THE ENGLISH LANGUAGE FILE PASTE THESE INTO THE ENGLISH LANGUAGE FILE [ @@ -91,7 +91,7 @@ We simply ask to create a new markdown file in `docs/adr` following the template In case you want to directly add a comment to a class, simply use the following template (based on [sustainable architectural decisions](https://www.infoq.com/articles/sustainable-architectural-design-decisions)): -``` +```text In the context of , facing we decided for