Skip to content

Some YALO warnings are duplicated #26

@NathanReb

Description

@NathanReb

I noticed some warnings appear twice, for example, warning YALO 14:

File "src/oui_lib/info_plist.ml", lines 74-77, characters 4-29
Warning (YALO+14): (a ^ b ^ c) should be replaced by Printf.sprintf "%s%s%s" a b c

00072   let to_xml (plist : t) =
00073     let header =
00074 >     "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ^
00075 >     "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" " ^
00076 >     "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" ^
00077 >     "<plist version=\"1.0\">"
            ^^^^^^^^^^^^^^^^^^^^^^^^^
00078     in
00079     let content = value_to_xml_element "" (Dict plist) in
00080     let footer = "</plist>" in

File "src/oui_lib/info_plist.ml", lines 75-77, characters 4-29
Warning (YALO+14): (a ^ b ^ c) should be replaced by Printf.sprintf "%s%s%s" a b c

00073     let header =
00074       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ^
00075 >     "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" " ^
00076 >     "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" ^
00077 >     "<plist version=\"1.0\">"
            ^^^^^^^^^^^^^^^^^^^^^^^^^
00078     in
00079     let content = value_to_xml_element "" (Dict plist) in
00080     let footer = "</plist>" in

or YALO 17:

File "src/oui_lib/opam_frontend.ml", line 40, characters 6-7
Warning (YALO+17): "( expr ; expr )" is misleading because "(" should not hide a side-effects

00038       try Wix.Version.of_string pkg_version
00039       with Failure _ ->
00040 >       (OpamConsole.warning
              ^
00041            "Package version %s contains characters not accepted by MSI."
00042            (OpamConsole.colorise `underline pkg_version);
00043          let use = "use config file to set it or option --with-version" in

File "src/oui_lib/opam_frontend.ml", line 40, characters 6-7
Warning (YALO+17): "( expr ; expr )" is misleading because "(" should not hide a side-effects

00038       try Wix.Version.of_string pkg_version
00039       with Failure _ ->
00040 >       (OpamConsole.warning
              ^
00041            "Package version %s contains characters not accepted by MSI."
00042            (OpamConsole.colorise `underline pkg_version);
00043          let use = "use config file to set it or option --with-version" in

I suspect this is in fact a problem with the driver running the lint on both the source file and the preprocessed version in dune projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions