Skip to content

Commit

Permalink
[chore] Sort lints by id in th lints list
Browse files Browse the repository at this point in the history
Signed-off-by: Kakadu <[email protected]>
  • Loading branch information
Kakadu committed Jan 2, 2025
1 parent 58aafc1 commit dd0465b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Lint_filesystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ TODO: Add custom configuration for this.
|> Stdlib.String.trim
;;

let describe_as_json () = Utils.describe_as_clippy_json "lint_filesystem" ~docs
let lint_id = "lint_filesystem"
let describe_as_json () = Utils.describe_as_clippy_json lint_id ~docs
1 change: 1 addition & 0 deletions src/Lint_filesystem.mli
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

val check : Dune_project.t list -> unit
val describe_as_json : unit -> Yojson.Safe.t
val lint_id : string
8 changes: 5 additions & 3 deletions src/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,13 @@ let () =
let info =
List.concat
[ List.map untyped_linters ~f:(fun (module L : LINT.UNTYPED) ->
L.describe_as_json ())
L.lint_id, L.describe_as_json ())
; List.map typed_linters ~f:(fun (module L : LINT.TYPED) ->
L.describe_as_json ())
; [ Lint_filesystem.describe_as_json () ]
L.lint_id, L.describe_as_json ())
; [ Lint_filesystem.lint_id, Lint_filesystem.describe_as_json () ]
]
|> List.sort ~compare:(fun (a, _) (b, _) -> String.compare a b)
|> List.map ~f:snd
in
let ch = Caml.open_out filename in
Exn.protect
Expand Down

0 comments on commit dd0465b

Please sign in to comment.