Drop checks no-packager, invalid-packager
This commit contains,
- Modified docstrings to google-style-docstrings
- Deletion of no-packager and invalid-packager
- Why were these checks dropped?
These check are no longer used in openSUSE(tw, lp), Rhel
systems(Fedora), Arch, Mageia, Rosalab or are either frowned upon for
usage by packagers
-
- Fix typo in line 575 confifdefaults.toml -> configdefaults.toml
Fix lgtm unused variable warning
This commit contains,
- Conversion of checks to individual methods
- self._check_invalid_packager
- self._check_invalid_version_and_no_version_tag
- self._check_non_standard_release_extension
- self._check_no_epoch_tag
- self._check_no_epoch_in_tags
- self._check_no_epoch_in_dependency
- self._check_no_name_tag
- self._check_summary_tag
- self._check_description_tag
- self._check_group_tag
- self._check_buildhost_tag
- self._check_changelog_tag
- self._check_license
- self._check_url
- self._check_obsolete_not_provided
- self._check_useless_provides
- self._check_forbidden_controlchar_one
- self._check_forbidden_controlchar_two
- self._check_self_obsoletion
- self._check_non_coherent_filename
- Rename of variables to snake-case-naming style
- x -> var (_check_no_epoch_in_tags)
- d -> dep (_check_no_epoch_in_dependency)
- r -> req (_check_no_epoch_in_dependency)
- d -> deptoken (_check_no_name_tag)
- x -> var (_check_no_name_tag)
- p -> pep (_check_no_name_tag)
- x -> var (for pep in (var[0] for var in pkg.provides):)
- x -> var (ignored_words.update((var[0] for var in pkg.provides)
- s -> deptoken (_check_changelog_tag)
- e -> dep (_check_changelog_tag)
- o -> dep_token (_check_obsolete_not_provided)
- x -> var (_check_obsolete_not_provided)
- 0 -> dep_token [for dep_token in pkg.obsoletes:]
- p -> prov (_check_useless_provides)
- p -> item (_check_forbidden_controlchar_one)
- e -> dep (_check_forbidden_controlchar_one)
- p -> pkg_token(_check_forbidden_controlchar_two)
- e -> dep (_check_forbidden_controlchar_two)
- Conversion of %s string format to {}.format method
- %s to .format in (_check_no_epoch_in_tags)
- %s to .format in [self._unexpanded_macros(pkg, 'dependency {}'.format(value,), value)]
- %s to .format in [if hasattr(rpm, 'RPMTAG_{}'.format(tag.upper())):]
- %s to .format in [self._unexpanded_macros(pkg, 'Obsoletes {}'.format(value,), value]
- %s to .format in [{}: {}'.format(tagname, dep)]
- %s to .format in [self._unexpanded_macros(pkg, '{} {}'.format(tagname, value), value)]
- %s to .format in ['Requires: {}'.format(dep))]
- %s to .format in ['{} obsoletes {}'.format(Pkg.formatRequire(*obs), Pkg.formatRequire(*prov))]
As it needs the zstd import we are passing we need the new dep
(not detected by tests as we don't have anything zstd compressed there).
Also fix other flake8 errors.
This commit contains,
- Modified no-changelogname-tag toml
- Reason:
The check is triggered when either the %changelog is empty or
%changelog tag is not present.
- Tested with:
(error in stdout)
- invalid-version-0pre-3.1.x86_64.rpm (no %changelog section)
- invalid-dependency-0-0.x86_64.rpm (empty %changelog section)
(error not in stdout)
- hello-2.0-1.x86_64-signed.rpm (non-empty %changelog section)
Now we will allow adding new descriptions strings for the rpmlint
errors in configuration files. The new error descriptions can be
defined in TOML syntax as [Descriptions] table with key/value pairs,
where key is the rpmlint error name and value is the new text for
that error.
Example:
[Descriptions]
no-binary = """
A new text for no-binary error.
"""
Add support for loading not only one configuration file but also
a directory with multiple *.toml configs with '-c' or '--config'
parameter.
Parametrize test_run_full_rpm and test_run_full_specs tests so they
will test multiple configuration files located in 'configs' directory.
Improve the docstring so it's obvious now that we want
tmpfiles to be marked as %ghost. Also add a test rpm for
a usecase where tmpfiles are packaged correctly and no
rpmlint errors are printed.
fix#326
Separate SignatureCheck to functions and add tests. Also, rewrite the
logic as SignatureCheck was obsolete and didn't work properly
(e.g. it searched for "MISSING KEYS" and "pgp|gpg" strings that are no
longer used in 'rpm -K' output).
Now it checks the output of 'rpm -Kv' which provides more detailed output.
Thanks to that we could add another check ('E: invalid-signature' that
checks if the signature is corrupted or not).
The test_signature.py file was added so now all 3 signature checks are
tested properly.