[
https://issues.apache.org/jira/browse/NUTCH-3215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18121995#comment-18121995
]
ASF GitHub Bot commented on NUTCH-3215:
---------------------------------------
lewismc opened a new pull request, #974:
URL: https://github.com/apache/nutch/pull/974
This PR addresses the remainder of
[NUTCH-3215](https://issues.apache.org/jira/browse/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
```
> Remove trailing whitespace reported by Yetus blanks on master
> -------------------------------------------------------------
>
> Key: NUTCH-3215
> URL: https://issues.apache.org/jira/browse/NUTCH-3215
> Project: Nutch
> Issue Type: Improvement
> Components: ci/cd
> Affects Versions: 1.23
> Reporter: Lewis John McGibbney
> Assignee: Lewis John McGibbney
> Priority: Minor
> Fix For: 1.24
>
>
> Apache Yetus test-patch on the master branch reports:
> The source tree has 1740 line(s) that end in blanks.
> This is the Yetus "blanks" plugin (EOL trailing spaces) on a full-tree run,
> not a patch-only check. See .github/workflows/yetus.yml and
> https://yetus.apache.org/documentation/0.15.1/precommit/plugins/blanks/
> A local scan of git-tracked UTF-8 files shows on the order of ~1.8k lines
> with trailing spaces. After excluding CHANGES.md (already listed in
> .yetus/blanks-eol.txt), the remainder is ~1740 and is concentrated in src/
> (Java, plugin XML, HTML test samples) plus smaller counts in conf/, ivy/,
> default.properties, and bundled license text.
> Why this should be fixed:
> * Master Yetus stays red/noisy for a mechanical style issue.
> * New PRs inherit the full-tree baseline, which drowns real patch findings.
> * Trailing spaces are not part of Nutch's intended formatting
> (eclipse-codeformat.xml).
> No functional change is intended.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)