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

Add disallow multiple empty lines #1427

Merged
merged 3 commits into from Dec 13, 2019

Conversation

sehrope
Copy link
Member

@sehrope sehrope commented Feb 27, 2019

Adds checkstyle rule for disallowing multiple empty newlines. Split into three commits:

  • First one adds an unrelated newline in dist.xml
  • Second one is the "big" one that is kind of funny because the diff excluding newlines is totally empty.
  • Third one adds the new checkstyle rule

The majority of the deletions in the second commit are doubled newlines. There's also a handful of manual single newline cleanups for tests to align the code blocks (ex: see pgjdbc/src/test/java/org/postgresql/test/jdbc42/PreparedStatementTest.java).

@AppVeyorBot
Copy link

@AppVeyorBot AppVeyorBot commented Feb 27, 2019

@codecov-io
Copy link

@codecov-io codecov-io commented Feb 27, 2019

Codecov Report

Merging #1427 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #1427      +/-   ##
============================================
+ Coverage     68.83%   68.84%   +0.01%     
- Complexity     4088     4089       +1     
============================================
  Files           181      181              
  Lines         16958    16958              
  Branches       2789     2789              
============================================
+ Hits          11673    11675       +2     
  Misses         4007     4007              
+ Partials       1278     1276       -2

@sehrope sehrope force-pushed the add-disallow-multiple-empty-lines branch from 770b4cf to 01b7f8b Compare Apr 6, 2019
@AppVeyorBot
Copy link

@AppVeyorBot AppVeyorBot commented Apr 6, 2019

@davecramer davecramer assigned davecramer and sehrope and unassigned davecramer Dec 12, 2019
@davecramer
Copy link
Member

@davecramer davecramer commented Dec 12, 2019

@sehrope sorry, but can you fix the conflicts and I'll push this ASAP

@sehrope sehrope force-pushed the add-disallow-multiple-empty-lines branch from 01b7f8b to b458c6c Compare Dec 12, 2019
@sehrope
Copy link
Member Author

@sehrope sehrope commented Dec 12, 2019

Amazingly even with the flurry of activity everything rebased cleanly 🎉. I also added a few more fixes for new code that has gone in since Feb.

Rrunning git diff --ignore-blank-lines HEAD~3 shows nothing changing outside the newlines and checkstyle config:

diff --git a/pgjdbc/src/assembly/dist.xml b/pgjdbc/src/assembly/dist.xml
index 6bd4f9d4..331b4aa4 100644
--- a/pgjdbc/src/assembly/dist.xml
+++ b/pgjdbc/src/assembly/dist.xml
@@ -40,4 +40,4 @@
       <scope>runtime</scope>
     </dependencySet>
   </dependencySets>
-</assembly>
\ No newline at end of file
+</assembly>
diff --git a/pgjdbc/src/main/checkstyle/checks.xml b/pgjdbc/src/main/checkstyle/checks.xml
index 6221650e..75f4095b 100644
--- a/pgjdbc/src/main/checkstyle/checks.xml
+++ b/pgjdbc/src/main/checkstyle/checks.xml
@@ -101,6 +100,7 @@
     <module name="EmptyLineSeparator">
       <property name="allowNoEmptyLineBetweenFields" value="true"/>
       <property name="allowMultipleEmptyLines" value="false"/>
+      <property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
     </module>
     <module name="SeparatorWrap">
       <property name="tokens" value="DOT"/>

@davecramer Once this passes CI it should be good to merge.

@davecramer davecramer merged commit be5c9f4 into pgjdbc:master Dec 13, 2019
3 checks passed
davecramer pushed a commit to davecramer/pgjdbc that referenced this issue Jul 5, 2021
* style: Add allowMultipleEmptyLinesInsideClassMembers set to false

Adds a checkstyle rule to disallow multiple back to back empty newlines inside class members.
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.

None yet

4 participants