Skip to content

NUTCH-3215 Remove trailing whitespace reported by Yetus blanks on master - #974

Open
lewismc wants to merge 1 commit into
apache:masterfrom
lewismc:NUTCH-3215-full-codebase
Open

lewismc wants to merge 1 commit into
apache:masterfrom
lewismc:NUTCH-3215-full-codebase

Conversation

@lewismc

@lewismc lewismc commented Oct 2, 2026

Copy link
Copy Markdown
Member

This PR addresses the remainder of NUTCH-3215. The first pull request only removed trailing spaces. Yetus treats "end in blanks" as any trailing space or tab, and it has a second, separate vote for tab characters anywhere in a line. Both of those were still present after #971 merged.

Whilst I was looking at this, I was curious about whether the Eclipse profile in eclipse-codeformat.xml and Yetus agreed/disagreed on anything.The Eclipse profile sets tabulation.char to space, with both tabulation.size and indentation.size at 2. Yetus blanks fails a file that contains a tab character, or a line that ends in a space or a tab. A Java file formatted with that profile satisfies both of those checks. Yetus does not care that the indent is 2 rather than 4, and it does not apply the Eclipse line length of 80.

Two limits keep them from being the same convention:

  • The Eclipse profile formats Java only. Yetus blanks scans the whole tree, including XML, HTML, shell scripts, and properties files. Those files are aligned with Yetus only if they also use spaces and have no trailing blanks. The tab-delimited data files listed in .yetus/blanks-tabs.txt are an intentional exception.
  • Because .yetus/blanks-tabs.txt exists, Yetus uses that file instead of its built-in exceptions for Makefiles and Go. This repository does not list those patterns. A Makefile that uses tabs for recipes would fail Yetus even though that is normal Make, and the Eclipse profile would not touch it.

After running Yetus locally everything checks out

mkdir -p /tmp/nutch-yetus-out
docker run --rm \
  -v "$PWD":/src \
  -v /tmp/nutch-yetus-out:/out \
  -w /src \
  ghcr.io/apache/yetus:0.15.1 \
  test-patch \
    --basedir=/src \
    --patch-dir=/out \
    --build-tool=nobuild \
    --plugins=blanks \
    --empty-patch \
    --project=nutch \
    --blanks-eol-ignore-file=.yetus/blanks-eol.txt \
    --blanks-tabs-ignore-file=.yetus/blanks-tabs.txt \
    --java-home=/usr/lib/jvm/java-11-openjdk-amd64

@lewismc lewismc self-assigned this Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Apache Yetus test-patch report

+1 overall
Vote Subsystem Runtime Log Comment
Prechecks
+1 dupname 0m 0s No case conflicting files found.
+1 @author 0m 0s The patch does not contain any @author tags.
master Compile Tests
+1 javadoc 0m 1s master passed
Patch Compile Tests
+1 codespell 0m 2s No new issues.
+1 detsecrets 0m 35s No new issues.
+1 blanks 0m 0s The patch has no blanks issues.
+1 xmllint 0m 0s No new issues.
+1 javadoc 0m 1s the patch passed
Other Tests
+1 asflicense 0m 1s The patch does not generate ASF License warnings.
0m 48s
Subsystem Report/Notes
GITHUB PR #974
Optional Tests dupname asflicense codespell detsecrets javac javadoc xmllint
uname Linux a8c6598747a1 6.17.0-1022-azure #22-Ubuntu SMP Mon Jul 27 17:24:03 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool nobuild
Personality /github/workspace/.yetus/personality.sh
git revision master / 679a3b3
Default Java Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu122.04
modules C: . U: .
versions git=2.34.1 codespell=2.4.1 detsecrets=1.5.0 xmllint=20913
Powered by Apache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

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.

1 participant