Skip to content

Simplify internal linting function - #7142

Draft
rjbou wants to merge 1 commit into
ocaml:masterfrom
rjbou:check-double-lint
Draft

rjbou wants to merge 1 commit into
ocaml:masterfrom
rjbou:check-double-lint

Conversation

@rjbou

@rjbou rjbou commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Seen while reviewing #7130, queued on it

(None, OpamStd.String.Map.empty)
|> snd
List.fold_left (fun dbl elem ->
OpamStd.String.Map.update (to_str elem)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

we could have OpamStd.MAP as an argument too have a proper map, but we would need to create the map for OpamHash.kind locally, or in the module, just for this use case.

Comment on lines 419 to 420
if OpamStd.String.Map.is_empty double then false, None else
true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

while we're simplifying this function, i think returning a tuple here is redundant (fst = Option.is_some snd)

Comment on lines 422 to 423
Printf.sprintf "%s: %d occurence%s"
elem occ (if occ = 1 then "" else "s"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here, this check is superfluous:

Suggested change
Printf.sprintf "%s: %d occurences"
elem occ)

@kit-ty-kate kit-ty-kate added this to the 2.7.0~alpha1 milestone Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants