{"id":21947588,"url":"https://github.com/rpm-software-management/rpmlint","last_synced_at":"2025-04-14T01:00:26.517Z","repository":{"id":34830803,"uuid":"38818937","full_name":"rpm-software-management/rpmlint","owner":"rpm-software-management","description":"Tool for checking common errors in rpm packages","archived":false,"fork":false,"pushed_at":"2025-04-10T11:30:51.000Z","size":40739,"stargazers_count":148,"open_issues_count":87,"forks_count":117,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-14T01:00:07.758Z","etag":null,"topics":["lint","rpm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpm-software-management.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-09T12:28:52.000Z","updated_at":"2025-04-11T23:10:34.000Z","dependencies_parsed_at":"2023-09-27T16:11:18.481Z","dependency_job_id":"8c685e50-df20-41fd-91ae-840bfefb55f5","html_url":"https://github.com/rpm-software-management/rpmlint","commit_stats":{"total_commits":2980,"total_committers":84,"mean_commits":"35.476190476190474","dds":0.6828859060402684,"last_synced_commit":"8ae737c5b7e539a5fb1b9d24aad9bf68c8c4d579"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpm-software-management%2Frpmlint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpm-software-management%2Frpmlint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpm-software-management%2Frpmlint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpm-software-management%2Frpmlint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpm-software-management","download_url":"https://codeload.github.com/rpm-software-management/rpmlint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804790,"owners_count":21164132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lint","rpm"],"created_at":"2024-11-29T05:02:54.624Z","updated_at":"2025-04-14T01:00:26.492Z","avatar_url":"https://github.com/rpm-software-management.png","language":"Python","funding_links":[],"categories":["Other","RPM"],"sub_categories":["Snippets and tricks"],"readme":"# rpmlint\n\n\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"rpmlint.svg\" width=\"200\"\u003e\n\u003c/h1\u003e\n\n[![Build and Test](https://github.com/rpm-software-management/rpmlint/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/rpm-software-management/rpmlint/actions/workflows/main.yml)\n[![Build and Test 2](https://github.com/rpm-software-management/rpmlint/actions/workflows/main.yml/badge.svg?branch=opensuse)](https://github.com/rpm-software-management/rpmlint/actions/workflows/main.yml)\n[![build result](https://build.opensuse.org/projects/devel:openSUSE:Factory:rpmlint/packages/rpmlint/badge.svg?type=default)](https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint)\n[![repology](https://repology.org/badge/latest-versions/rpmlint.svg)](https://repology.org/project/rpmlint/versions)\n[![Coverage Status](https://coveralls.io/repos/github/rpm-software-management/rpmlint/badge.svg)](https://coveralls.io/github/rpm-software-management/rpmlint)\n\n`rpmlint` is a tool for checking common errors in RPM packages.\n`rpmlint` can be used to test individual packages before uploading or to check\nan entire distribution.\n\n`rpmlint` can check binary RPMs, source RPMs, and plain specfiles, but all\nchecks do not apply to all argument types.\nFor best check coverage, run `rpmlint` on source RPMs instead of\nplain specfiles.\n\nThe idea for `rpmlint` is from the lintian tool of the Debian project.\nAll the checks reside in `rpmlint/checks` folder. Feel free to provide new\nchecks and suggestions at:\n\nhttps://github.com/rpm-software-management/rpmlint\n\n## Install\n\nFor installation on your machine you will need the following packages:\n\nMandatory:\n- Python 3.8 or newer\n- python3-setuptools, python3-tomli (for `python3 \u003c 3.11`), python3-tomli-w,\n  python3-pyxdg, python3-pybeam\n- rpm and its python bindings\n- binutils, cpio, gzip, bzip, xz and zstd\n\nOptional, for running the test suite:\n- devscripts\n- dash\n- a 32-bit glibc if on a 64-bit architecture\n- desktop-file-utils\n- libmagic and its python bindings\n- enchant and its python bindings, along with en_US and cs_CZ dictionaries\n- appstream-util, part of appstream-glib\n\n`rpmlint` is part of most distributions and as an user you can simply\n\n    dnf install rpmlint\n\n## Testing\n\nYou will need to have all the required modules as listed on the Install section above.\nYou will also need `pytest`,`pytest-cov` and `pytest-xdist`, \nwhich you can install individually or by running:\n\n    pip install -e \".[test]\"\n\nIf all the dependencies are present you can just execute tests using:\n\n    python3 -m pytest\n\nOr even pick one of the tests using `pytest`:\n\n    python3 -m pytest test/test_config.py\n\n## Bugfixing and contributing\n\nAny help is, of course, welcome but honestly most probable cause for your visit\nhere is that `rpmlint` is marking something as invalid while it shouldn't or\nit is marking something as correct while it should not either :)\n\nNow there is an easy way how to fix that. Our testsuite simply needs an\nextension to take the above problem into the account.\n\nPrimarily we just need the offending rpm file (best the smallest you can\nfind or we would soon take few GB to take a checkout) and some basic\nexpectation of what should happen.\n\n### Building the installable rpm and installing\nThis section focuses on how to build the tool as you develop it.\n\nTo build the tool, we'll use a tool called `packit`. First, install `packit` on your system:\n\n    dnf install packit\n\nThen, build the project using:\n\n    packit build locally\n\nIf you encounter any errors, install the missing dependencies and run the same command again. Once the build is successful, you'll find a RPM file under the `noarch` directory. To install the package on your system, run:\n\n    dnf install \u003cthe_rpm_you_just_built\u003e\n\nAlternatively, the built binary can be found in the `rpmlint` directory under the `.packit` directory, which you can run directly.\n\n### Example workflow for testing a functionality\n\n1) I have rpmfile that should report unreadable zip file\n2) I store this file in git under `test/binary/texlive-codepage-doc-2018.151.svn21126-38.1.noarch.rpm`\n3) Now I need to figure out what `check` should test this, in this case `test_zip.py`\n4) For the testing I will have to devise a small function that validates my expectations:\n\n```\n@pytest.mark.parametrize('package', ['binary/texlive-codepage-doc'])\ndef test_zip2(tmpdir, package, zipcheck):\n    output, test = zipcheck\n    test.check(get_tested_package(package, tmpdir))\n    out = output.print_results(output.results)\n    assert 'W: unable-to-read-zip' in out\n```\n\nAs you can see it is not so hard and with each added test we get better\ncoverage on what is really expected from rpmlint and avoid naughty regressions\nin the long run.\n\nPreferable approach for binary packages is to create artificial testcase (to keep binaries small and trivial).\nWe are currently using OBS to produce binaries:\nhttps://build.opensuse.org/project/show/devel:openSUSE:Factory:rpmlint:tests\n\nFor a sample package see:\nhttps://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint:tests/non-position-independent-exec\n\n## Configuration\n\nIf you want to change configuration options or the list of checks you can\nuse the following locations:\n\n`/etc/xdg/rpmlint/*toml`\n\n`$XDG_CONFIG_HOME/rpmlint/*toml`\n\nThe configuration itself is a `toml` file where for some basic inspiration\nyou can check up [`rpmlint/configdefaults.toml`](rpmlint/configdefaults.toml) which specifies format/defaults.\n\nOne can also include additional configuration files (or directories) by using the `--config` option.\nNote that all TOML configuration values are merged and not overridden.\nSo e.g. values in a list are concatenated. If you need an override,\nuse `*.override.*toml` configuration file, where all defined values are selected as default.\n\nAdditional option to control `rpmlint` behaviour is the addition of `rpmlintrc` file\nwhich uses old syntax for compatibility with old `rpmlint` releases, yet\nit can be normal `toml` file if you wish:\n\n    setBadness('check', 0)\n    addFilter('test-i-ignore')\n\nThe location of `rpmlintrc` can be set using `--rpmlintrc` option.\nOr it can load any `*.rpmlintrc` or `*-rpmlintrc` that are located in the same\nfolder as check RPM file (or a specfile). Note the auto-loading happens only\nwhen one RPM file (or a specfile) is used.\nThe best practice is to store the name in `$PACKAGE_NAME.rpmlintrc`.\n\n`setBadness` overrides a default badness for a given check and `addFilter` ignores all errors\nthat match the given regular expression (one cannot filter out errors that are listed in `BlockedFilters`\nin a configuration file).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpm-software-management%2Frpmlint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpm-software-management%2Frpmlint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpm-software-management%2Frpmlint/lists"}