Filter out empty specfile-errors, they are duplicates

Before:

    $ rpmlint python-setuptools.spec
    python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 58:  %endif # with tests
    python-setuptools.spec: E: specfile-error
    python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 67:  %endif # without bootstrap
    python-setuptools.spec: E: specfile-error
    python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 181:  %endif # with tests
    0 packages and 1 specfiles checked; 5 errors, 0 warnings.

After:

    $ rpmlint python-setuptools.spec
    python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 58:  %endif # with tests
    python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 67:  %endif # without bootstrap
    python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 181:  %endif # with tests
    0 packages and 1 specfiles checked; 3 errors, 0 warnings.
This commit is contained in:
Miro Hrončok 2021-04-13 10:48:05 +02:00
parent 6f1c44bf23
commit 8c896377da
2 changed files with 7 additions and 1 deletions

View File

@ -463,6 +463,9 @@ addFilter("postin-without-install-info")
addFilter(r"zero-length .+/site-packages/.+\.dist-info/REQUESTED\b")
# py.typed files are empty
addFilter(r"zero-length .+/site-packages/.+/py\.typed\b")
# specfile-errors are listed twice, once with reason and once without
# we filter out the empty ones
addFilter(r"\.(src|spec): (E|W): specfile-error\s+$")
bad_crypto_warning = \
'''This application package calls a function to explicitly set crypto ciphers

View File

@ -20,7 +20,7 @@
Name: rpmlint
Version: 1.11
Release: 15%{?dist}
Release: 16%{?dist}
Summary: Tool for checking common errors in RPM packages
License: GPLv2
URL: https://github.com/rpm-software-management/rpmlint
@ -165,6 +165,9 @@ make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8}
%{_mandir}/man1/rpmlint.1*
%changelog
* Tue Apr 13 2021 Miro Hrončok <mhroncok@redhat.com> - 1.11-16
- Filter out empty specfile-errors, they are duplicates
* Fri Feb 5 2021 Tom Callaway <spot@fedoraproject.org> - 1.11-15
- correct hard-coded version in Makefile