Skip to content

fix(DL3041): Prevent false negatives for packages which include a dash in their package name#1098

Merged
m-ildefons merged 2 commits intohadolint:masterfrom
egfx-notifications:fix/dl3041-improve-version-detection
Aug 15, 2025
Merged

fix(DL3041): Prevent false negatives for packages which include a dash in their package name#1098
m-ildefons merged 2 commits intohadolint:masterfrom
egfx-notifications:fix/dl3041-improve-version-detection

Conversation

@egfx-notifications
Copy link
Copy Markdown
Contributor

What I did

Prevent false negatives for packages which include a dash in their package name

How I did it

Tries to validate presence of a version based on the following assumptions:

  • At least one "-" must be present
  • All dash-separated parts after the first must contain only valid version characters (according to Fedora Versioning Guidelines)
  • At least one dash-separated part after the first must start with a digit

How to verify it

Unit tests included

Fixes #1002

Please note that this is my first time writing Haskell, so please suggest changes if there are better ways to do this.

…h in their package name

Tries to validate presence of a version based on the following assumptions:
- At least one "-" must be present
- All dash-separated parts after the first must contain only valid version characters (according to Fedora Versioning Guidelines)
- At least one dash-separated part after the first must start with a digit

Fixes hadolint#1002
Copy link
Copy Markdown
Member

@m-ildefons m-ildefons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Florian,

thanks for the contribution. It looks pretty good and I'd accept it.

I've put some suggestions, since you asked for it. But don't take them too harshly, they are pretty nit-picky.

@egfx-notifications
Copy link
Copy Markdown
Contributor Author

Hi Florian,

thanks for the contribution. It looks pretty good and I'd accept it.

I've put some suggestions, since you asked for it. But don't take them too harshly, they are pretty nit-picky.

Thanks! That really helps. I tried to address your feedback with a follow-up commit, please have a look :)

@m-ildefons m-ildefons merged commit 526d840 into hadolint:master Aug 15, 2025
2 checks passed
@m-ildefons
Copy link
Copy Markdown
Member

Great. Thanks a lot for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DNF Rule "Specify Version" Not Applying to dnf-plugins-core

2 participants