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

Enforce LeftCurly rule #6452

Merged
merged 15 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 25 additions & 27 deletions config/IntelliJ Code Style.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
<code_scheme name="JabRef">
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="javafx" withSubpackages="true" static="false" />
<emptyLine />
<package name="org.jabref" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
<option name="JD_P_AT_EMPTY_LINES" value="false" />
<option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
<option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
<option name="JD_KEEP_EMPTY_RETURN" value="false" />
<option name="WRAP_COMMENTS" value="true" />
<code_scheme name="JabRef" version="173">
<option name="RIGHT_MARGIN" value="140" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
Copy link
Member

Choose a reason for hiding this comment

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

I think we had a discussion about this some time ago and decided against having a hard line wrap (reasoning was "old school, everybody has wide monitors now anyway" if I remember correctly).

Copy link
Member

Choose a reason for hiding this comment

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

Yes, no hard-line wrap. I remember the discussion

Copy link
Member Author

Choose a reason for hiding this comment

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

I think, we did not adapt the config and we had no issues until I applied the automatic formatting today. Either none of use applied to automatic formatting before or was a wizzard in git gui only committing the reformat of code; not that of the comments.

I did the latter one often. However, currentyl, I believe, I cannot really explain to contributors that we have automatic tooling, but one cannot fully use it.

I changed the limit to 500 characters at 59938a9. This should be high enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the hard limit as we have files with 510 or 5000 characters line length.

<JavaCodeStyleSettings>
<option name="DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="javafx" withSubpackages="true" static="false" />
<emptyLine />
<package name="org.jabref" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
</JavaCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
<option name="WRAP_COMMENTS" value="true" />
<arrangement>
<rules>
<section>
Expand Down Expand Up @@ -292,4 +290,4 @@
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</code_scheme>
5 changes: 3 additions & 2 deletions src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ default boolean childIsFocused() {
/**
* Returns relative size of the field editor in terms of display space.
* <p>
* A value of 1 means that the editor gets exactly as much space as all other regular editors. A value of 2 means
* that the editor gets twice as much space as regular editors.
* A value of 1 means that the editor gets exactly as much space as all other regular editors.
* <p>
* A value of 2 means that the editor gets twice as much space as regular editors.
*
* @return the relative weight of the editor in terms of display space
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.slf4j.LoggerFactory;

/**
* Represents the full internal name of a column in the main table. Consists of two parts: The type of the column and a
* qualifier, like the field name to be displayed in the column.
* Represents the full internal name of a column in the main table. Consists of two parts: The type of the column and a qualifier, like the
* field name to be displayed in the column.
*/
public class MainTableColumnModel {

Expand Down Expand Up @@ -99,8 +99,7 @@ public MainTableColumnModel(Type type, String qualifier) {
}

/**
* This is used by the preferences dialog, to initialize available basic icon columns, the user can add to the
* table.
* This is used by the preferences dialog, to initialize available basic icon columns, the user can add to the table.
*
* @param type the {@code MainTableColumnModel.Type} of the column, e.g. "GROUPS" or "LINKED_IDENTIFIER"
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,13 @@ public void resetDefaultLayout() {
}

/**
* XML-Syntax-Highlighting for RichTextFX-Codearea created by (c) Carlos Martins (github: @cemartins) License:
* BSD-2-Clause see https://github.com/FXMisc/RichTextFX/blob/master/LICENSE and:
* https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/README.md#xml-editor
* XML-Syntax-Highlighting for RichTextFX-Codearea created by (c) Carlos Martins (github:
* <a href="https://github.com/cmartins">@cemartins</a>)
* <p>
* License: <a href="https://github.com/FXMisc/RichTextFX/blob/master/LICENSE">BSD-2-Clause</a>
* <p>
* See also
* <a href="https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/README.md#xml-editor">https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/README.md#xml-editor</a>
*
* @param text to parse and highlight
* @return highlighted span for codeArea
Expand Down Expand Up @@ -379,8 +383,7 @@ public void dragDetected(ListProperty<PreviewLayout> sourceList, ObjectProperty<
}

/**
* This is called, when the user drops some PreviewLayouts either in the availableListView or in the empty space of
* chosenListView
* This is called, when the user drops some PreviewLayouts either in the availableListView or in the empty space of chosenListView
*
* @param targetList either availableListView or chosenListView
*/
Expand Down