Skip to content

Comments

[D] Slarn ml#106

Closed
ioannessh wants to merge 24 commits intoKakadu:masterfrom
ioannessh:slarnML
Closed

[D] Slarn ml#106
ioannessh wants to merge 24 commits intoKakadu:masterfrom
ioannessh:slarnML

Conversation

@ioannessh
Copy link
Contributor

No description provided.

@github-actions
Copy link

Linter report from 2025-03-21 8:37, for mini language slarnML

File '_build/default/lib/inferencer/typedtree.ml' doesn't have corresponding .mli interface
File '_build/default/lib/riscv64/riscv.ml' doesn't have corresponding .mli interface
File '_build/default/lib/res.ml' doesn't have corresponding .mli interface
File '_build/default/lib/inferencer/quick_check.ml' doesn't have corresponding .mli interface
File '_build/default/lib/pretty_print/pprint_riscv.ml' doesn't have corresponding .mli interface
File '_build/default/lib/pretty_print/pprint_ll.ml' doesn't have corresponding .mli interface
File '_build/default/lib/pretty_print/pprint_cc.ml' doesn't have corresponding .mli interface
File '_build/default/lib/pretty_print/pprint_anf.ml' doesn't have corresponding .mli interface
File '_build/default/lib/pretty_print/pprint.ml' doesn't have corresponding .mli interface
File '_build/default/lib/riscv64/call_define.ml' doesn't have corresponding .mli interface

File "test/parser_test.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "test/parser_test.ml", line 1:
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "test/clos_conv_test.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "test/clos_conv_test.ml", line 1:
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "test/lambda_lifting_test.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "test/lambda_lifting_test.ml", line 1:
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "test/anf_conv_test.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "test/anf_conv_test.ml", line 1:
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "test/riscv64_instr_test.ml", line 21, characters 32-49:
21 |   | SlarnML_lib.Res.Result r -> print_string @@ r
                                     ^^^^^^^^^^^^^^^^^
Alert zanuda-linter: Extranous `@@`.
File "test/riscv64_instr_test.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "test/riscv64_instr_test.ml", line 1:
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "lib/inferencer/typedtree.ml", lines 11-14, characters 0-10:
11 | type constTy =
12 |   | UnitTy
13 |   | IntTy
14 |   | BoolTy
Alert zanuda-linter: Type name `constTy` should be in snake case
File "lib/inferencer/typedtree.ml", lines 22-25, characters 0-13:
22 | type undefinedType =
23 |   | Type of ty
24 |   | Key of binder
25 |   | Undefined
Alert zanuda-linter: Type name `undefinedType` should be in snake case
File "lib/riscv64/riscv_ast.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "lib/riscv64/riscv_ast.ml", lines 1-8, characters 0-39:
1 | type reg =
2 |   | Zero (* Вечный и неизменный ноль *)
3 |   | Ra (* Адрес возврата *)
4 |   | Sp (* Stack pointer, указатель стека *)
5 |   | S of int (* Рабочие регистры 0-11 *)
6 |   | A of int (* Аргументы функции 0-7 / Возвращаемое значение функции 0,1 *)
7 |   | T of int (* Временные регистры 0-6 *)
8 | [@@deriving show { with_path = false }]
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "lib/riscv64/riscv.ml", lines 125-148, characters 10-29:
125 | ..........fun free ->
126 |       match free with
127 |       | [] ->
128 |         get_regs res
129 |         >>= fun regs ->
...
145 |            res
146 |            |> update_env f_offset (fun _ -> n_regs) f_offsets (fun fr -> reg :: fr)
147 |            >>= fun n_env -> Result (instr, n_env))
148 |       | _ -> Result ([], env).
Alert zanuda-linter: Using `function` is recommended
File "lib/riscv64/riscv.ml", lines 129-147, characters 12-50:
129 | ............fun regs ->
130 |         (match regs with
131 |          | [] -> Error "Regs not exists"
132 |          | (rid_opt, reg) :: n_regs ->
133 |            res
...
144 |            in
145 |            res
146 |            |> update_env f_offset (fun _ -> n_regs) f_offsets (fun fr -> reg :: fr)
147 |            >>= fun n_env -> Result (instr, n_env))
Alert zanuda-linter: Using `function` is recommended
File "lib/riscv64/riscv.ml", lines 205-209, characters 6-87:
205 | ......fun free ->
206 |   match free with
207 |   | [] -> Error "Free is empty"
208 |   | reg :: _ ->
209 |     res |> free_reg f reg >>= fun (b_instr, env) -> Result (instr1 @ b_instr, reg, env)
Alert zanuda-linter: Using `function` is recommended
File "lib/riscv64/riscv.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "lib/riscv64/riscv.ml", line 1, characters 0-14:
1 | open Riscv_ast
    ^^^^^^^^^^^^^^
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "lib/riscv64/riscv.ml", lines 125-148, characters 10-29:
125 | ..........fun free ->
126 |       match free with
127 |       | [] ->
128 |         get_regs res
129 |         >>= fun regs ->
...
145 |            res
146 |            |> update_env f_offset (fun _ -> n_regs) f_offsets (fun fr -> reg :: fr)
147 |            >>= fun n_env -> Result (instr, n_env))
148 |       | _ -> Result ([], env).
Alert zanuda-linter: Using `function` is recommended
File "lib/riscv64/riscv.ml", lines 129-147, characters 12-50:
129 | ............fun regs ->
130 |         (match regs with
131 |          | [] -> Error "Regs not exists"
132 |          | (rid_opt, reg) :: n_regs ->
133 |            res
...
144 |            in
145 |            res
146 |            |> update_env f_offset (fun _ -> n_regs) f_offsets (fun fr -> reg :: fr)
147 |            >>= fun n_env -> Result (instr, n_env))
Alert zanuda-linter: Using `function` is recommended
File "lib/riscv64/riscv.ml", lines 205-209, characters 6-87:
205 | ......fun free ->
206 |   match free with
207 |   | [] -> Error "Free is empty"
208 |   | reg :: _ ->
209 |     res |> free_reg f reg >>= fun (b_instr, env) -> Result (instr1 @ b_instr, reg, env)
Alert zanuda-linter: Using `function` is recommended
File "lib/res.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "lib/res.ml", lines 1-4, characters 0-39:
1 | type 'a res =
2 |   | Result of 'a
3 |   | Error of string
4 | [@@deriving show { with_path = false }]
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "lib/res.ml", lines 1-4, characters 0-39:
1 | type 'a res =
2 |   | Result of 'a
3 |   | Error of string
4 | [@@deriving show { with_path = false }]
Alert zanuda-linter: Constructor `Error` of this type should not look like defaults
File "lib/inferencer/quick_check_ast.ml", line 6, characters 12-18:
6 |   | TVar of tv ref
                ^^^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", lines 82-145, characters 52-15:
 82 | ....................................................expr =
 83 |     match expr with
 84 |     | Const c -> const_check c, ctx
 85 |     | Id x ->
 86 |       let t = List.assoc_opt x ctx in
...
142 |       let e3_t, _ = check ctx level e3 in
143 |       unify e1_t TBool;
144 |       unify e2_t e3_t;
145 |       e2_t, ctx
Alert zanuda-linter: Using `function` is recommended
File "lib/inferencer/quick_check.ml", line 11, characters 9-16:
11 |     incr counter;
              ^^^^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 12, characters 5-12:
12 |     !counter
          ^^^^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 39, characters 7-15:
39 |     if v1 == v2 then () else if l1 < l2 then v2 := Link t1 else v1 := Link t2
            ^^^^^^^^
Alert zanuda-linter: Do you really need physical equality? Physical means the equality of pointers.
File "lib/inferencer/quick_check.ml", line 39, characters 7-9:
39 |     if v1 == v2 then () else if l1 < l2 then v2 := Link t1 else v1 := Link t2
            ^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 39, characters 13-15:
39 |     if v1 == v2 then () else if l1 < l2 then v2 := Link t1 else v1 := Link t2
                  ^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 39, characters 45-47:
39 |     if v1 == v2 then () else if l1 < l2 then v2 := Link t1 else v1 := Link t2
                                                  ^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 39, characters 64-66:
39 |     if v1 == v2 then () else if l1 < l2 then v2 := Link t1 else v1 := Link t2
                                                                     ^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 41, characters 20-21:
41 |     if occurs_check v t then failwith "Occurs check failed" else v := Link t
                         ^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 41, characters 29-37:
41 |     if occurs_check v t then failwith "Occurs check failed" else v := Link t
                                  ^^^^^^^^
Alert zanuda-linter: Using `failwith` (or `assert false`) usually is a clue that a corner case is not being handled properly. To report errors we recommend using error monad instead. In princliple, these construction are OK for temporary work-in-progress code, but in release they should be eliminated
File "lib/inferencer/quick_check.ml", line 41, characters 65-66:
41 |     if occurs_check v t then failwith "Occurs check failed" else v := Link t
                                                                      ^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 47, characters 4-12:
47 |     failwith
         ^^^^^^^^
Alert zanuda-linter: Using `failwith` (or `assert false`) usually is a clue that a corner case is not being handled properly. To report errors we recommend using error monad instead. In princliple, these construction are OK for temporary work-in-progress code, but in release they should be eliminated
File "lib/inferencer/quick_check.ml", line 52, characters 19-26:
52 |     | TVar v' when v == v' -> true
                        ^^^^^^^
Alert zanuda-linter: Do you really need physical equality? Physical means the equality of pointers.
File "lib/inferencer/quick_check.ml", line 52, characters 19-20:
52 |     | TVar v' when v == v' -> true
                        ^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 52, characters 24-26:
52 |     | TVar v' when v == v' -> true
                             ^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 79, characters 12-20:
79 |     | [] -> failwith (Printf.sprintf "Args can't be empty")
                 ^^^^^^^^
Alert zanuda-linter: Using `failwith` (or `assert false`) usually is a clue that a corner case is not being handled properly. To report errors we recommend using error monad instead. In princliple, these construction are OK for temporary work-in-progress code, but in release they should be eliminated
File "lib/inferencer/quick_check.ml", lines 82-145, characters 52-15:
 82 | ....................................................expr =
 83 |     match expr with
 84 |     | Const c -> const_check c, ctx
 85 |     | Id x ->
 86 |       let t = List.assoc_opt x ctx in
...
142 |       let e3_t, _ = check ctx level e3 in
143 |       unify e1_t TBool;
144 |       unify e2_t e3_t;
145 |       e2_t, ctx
Alert zanuda-linter: Using `function` is recommended
File "lib/inferencer/quick_check.ml", line 88, characters 17-25:
88 |        | None -> failwith (Printf.sprintf "Variable '%s' not found in context" x)
                      ^^^^^^^^
Alert zanuda-linter: Using `failwith` (or `assert false`) usually is a clue that a corner case is not being handled properly. To report errors we recommend using error monad instead. In princliple, these construction are OK for temporary work-in-progress code, but in release they should be eliminated
File "lib/inferencer/quick_check.ml", line 150, characters 81-85:
150 |       | TVar { contents = Unbound (id, l) } when l > level && not (List.memq id !vars) ->
                                                                                       ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 151, characters 8-12:
151 |         vars := id :: !vars
              ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 151, characters 23-27:
151 |         vars := id :: !vars
                             ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 158, characters 80-84:
158 |     List.fold_right (fun v acc -> TFun (TVar (ref (Unbound (v, level))), acc)) !vars t
                                                                                      ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/inferencer/quick_check.ml", line 172, characters 21-22:
172 |     | TVar c -> TVar c
                           ^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/pretty_print/pprint_riscv.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "lib/pretty_print/pprint_riscv.ml", line 1, characters 0-14:
1 | open Riscv_ast
    ^^^^^^^^^^^^^^
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "lib/pretty_print/pprint_ll.ml", lines 9-32, characters 19-79:
 9 | ...................expr =
10 |   match expr with
11 |   | LId id -> id
12 |   | LConst c -> pp_const c
13 |   | LNot e -> concat "" [ "not "; pp_ll_expr e ]
...
29 |   | LApp (e, args) ->
30 |     concat "" [ "("; e; " "; concat " " (List.map pp_ll_expr args); ")" ]
31 |   | LIn (id, e1, e2) ->
32 |     concat "" [ "let "; id; " = ("; pp_ll_expr e1; " in "; pp_ll_expr e2; ")" ]
Alert zanuda-linter: Using `function` is recommended
File "lib/pretty_print/pprint_ll.ml", lines 9-32, characters 19-79:
 9 | ...................expr =
10 |   match expr with
11 |   | LId id -> id
12 |   | LConst c -> pp_const c
13 |   | LNot e -> concat "" [ "not "; pp_ll_expr e ]
...
29 |   | LApp (e, args) ->
30 |     concat "" [ "("; e; " "; concat " " (List.map pp_ll_expr args); ")" ]
31 |   | LIn (id, e1, e2) ->
32 |     concat "" [ "let "; id; " = ("; pp_ll_expr e1; " in "; pp_ll_expr e2; ")" ]
Alert zanuda-linter: Using `function` is recommended
File "lib/pretty_print/pprint_cc.ml", lines 8-43, characters 19-84:
 8 | ...................expr =
 9 |   match expr with
10 |   | CId id -> id
11 |   | CConst c -> Pprint_ast.pp_const c
12 |   | CNot e -> concat "" [ "not "; pp_cc_expr e ]
...
40 |       ]
41 |   | CFun (args, e) -> concat "" [ "(fun "; concat " " args; "->"; pp_cc_expr e; ")" ]
42 |   | CApp (e, args) ->
43 |     concat "" [ "("; pp_cc_expr e; " "; concat " " (List.map pp_cc_expr args); ")" ]
Alert zanuda-linter: Using `function` is recommended
File "lib/pretty_print/pprint_cc.ml", lines 8-43, characters 19-84:
 8 | ...................expr =
 9 |   match expr with
10 |   | CId id -> id
11 |   | CConst c -> Pprint_ast.pp_const c
12 |   | CNot e -> concat "" [ "not "; pp_cc_expr e ]
...
40 |       ]
41 |   | CFun (args, e) -> concat "" [ "(fun "; concat " " args; "->"; pp_cc_expr e; ")" ]
42 |   | CApp (e, args) ->
43 |     concat "" [ "("; pp_cc_expr e; " "; concat " " (List.map pp_cc_expr args); ")" ]
Alert zanuda-linter: Using `function` is recommended
File "lib/pretty_print/pprint_ast.ml", lines 22-45, characters 16-80:
22 | ................expr =
23 |   match expr with
24 |   | Id id -> id
25 |   | Const c -> pp_const c
26 |   | Not e -> concat "" [ "not "; pp_expr e ]
...
42 |     concat "" [ "(let "; expr_of_decl d; "="; pp_expr e2; " in "; pp_expr e3; ")" ]
43 |   | Fun (args, e) -> concat "" [ "(fun "; concat " " args; "->"; pp_expr e; ")" ]
44 |   | App (e, args) ->
45 |     concat "" [ "("; pp_expr e; "->"; concat "->" (List.map pp_expr args); ")" ]
Alert zanuda-linter: Using `function` is recommended
File "lib/pretty_print/pprint_ast.ml", line 12, characters 14-88:
12 |   | CInt i -> if i < 0 then concat "" [ "("; string_of_int i; ")" ] else string_of_int i
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Alert zanuda-linter: Prefer guard instead of if-then-else in case construction
File "lib/pretty_print/pprint_ast.ml", lines 22-45, characters 16-80:
22 | ................expr =
23 |   match expr with
24 |   | Id id -> id
25 |   | Const c -> pp_const c
26 |   | Not e -> concat "" [ "not "; pp_expr e ]
...
42 |     concat "" [ "(let "; expr_of_decl d; "="; pp_expr e2; " in "; pp_expr e3; ")" ]
43 |   | Fun (args, e) -> concat "" [ "(fun "; concat " " args; "->"; pp_expr e; ")" ]
44 |   | App (e, args) ->
45 |     concat "" [ "("; pp_expr e; "->"; concat "->" (List.map pp_expr args); ")" ]
Alert zanuda-linter: Using `function` is recommended
File "lib/pretty_print/pprint.ml", lines 148-152, characters 11-76:
148 | ...........asm =
149 |   match asm with
150 |   | Error e -> print_string e
151 |   | Result prog ->
152 |     print_string @@ String.concat "\n" (List.map (pp_instruction "\t") prog)
Alert zanuda-linter: Using `function` is recommended
File "lib/pretty_print/pprint.ml", line 56, characters 26-55:
56 |   match clos_conv ast >>= fun ast -> lambda_lifting ast with
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Alert zanuda-linter: Eta reduction proposed. It's recommended to rewrite 
                     'fun ast -> lambda_lifting ast' as 'lambda_lifting'
File "lib/pretty_print/pprint.ml", lines 148-152, characters 11-76:
148 | ...........asm =
149 |   match asm with
150 |   | Error e -> print_string e
151 |   | Result prog ->
152 |     print_string @@ String.concat "\n" (List.map (pp_instruction "\t") prog)
Alert zanuda-linter: Using `function` is recommended
File "lib/pretty_print/pprint.ml", line 156, characters 26-55:
156 |   match clos_conv ast >>= fun ast -> lambda_lifting ast with
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Alert zanuda-linter: Eta reduction proposed. It's recommended to rewrite 
                     'fun ast -> lambda_lifting ast' as 'lambda_lifting'
File "lib/parser/parser.ml", line 135, characters 8-27:
135 |   e >>= fun init -> go init
              ^^^^^^^^^^^^^^^^^^^
Alert zanuda-linter: Eta reduction proposed. It's recommended to rewrite 
                     'fun init -> go init' as 'go'
File "lib/anf/lambda_lifting.ml", lines 157-160, characters 8-19:
157 | ........(fun a ->
158 |           match a with
159 |           | LId id -> LApp (id, [])
160 |           | e -> e)
Alert zanuda-linter: Using `function` is recommended
File "lib/anf/lambda_lifting.ml", lines 157-160, characters 8-19:
157 | ........(fun a ->
158 |           match a with
159 |           | LId id -> LApp (id, [])
160 |           | e -> e)
Alert zanuda-linter: Using `function` is recommended
File "lib/anf/lambda_lifting.mli", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "lib/anf/lambda_lifting.mli", line 1, characters 0-11:
1 | open Cc_ast
    ^^^^^^^^^^^
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "lib/anf/clos_conv.ml", lines 19-28, characters 22-15:
19 | ......................res =
20 |   match res with
21 |   | Error _ -> []
22 |   | Result (_, _, _, args, _) ->
23 |     (match a_id with
24 |      | CId id ->
25 |        (match List.find_opt (fun (i, _, _) -> i = id) args with
26 |         | None -> []
27 |         | Some (_, args, _) -> List.map (fun a -> CId a) args)
28 |      | _ -> [])
Alert zanuda-linter: Using `function` is recommended
File "lib/anf/clos_conv.ml", lines 208-214, characters 13-11:
208 | .............ast =
209 |   match ast with
210 |   | CLet (Decl (id, _), _) -> [ id ]
211 |   | CLetIn (Decl (id, _), _, _) -> [ id ]
212 |   | CLet (DeclRec (id, _), _) -> [ id ]
213 |   | CLetIn (DeclRec (id, _), _, _) -> [ id ]
214 |   | _ -> []
Alert zanuda-linter: Using `function` is recommended
File "lib/anf/clos_conv.ml", lines 19-28, characters 22-15:
19 | ......................res =
20 |   match res with
21 |   | Error _ -> []
22 |   | Result (_, _, _, args, _) ->
23 |     (match a_id with
24 |      | CId id ->
25 |        (match List.find_opt (fun (i, _, _) -> i = id) args with
26 |         | None -> []
27 |         | Some (_, args, _) -> List.map (fun a -> CId a) args)
28 |      | _ -> [])
Alert zanuda-linter: Using `function` is recommended
File "lib/anf/clos_conv.ml", lines 208-214, characters 13-11:
208 | .............ast =
209 |   match ast with
210 |   | CLet (Decl (id, _), _) -> [ id ]
211 |   | CLetIn (Decl (id, _), _, _) -> [ id ]
212 |   | CLet (DeclRec (id, _), _) -> [ id ]
213 |   | CLetIn (DeclRec (id, _), _, _) -> [ id ]
214 |   | _ -> []
Alert zanuda-linter: Using `function` is recommended
File "lib/anf/clos_conv.mli", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "lib/anf/clos_conv.mli", line 1, characters 0-8:
1 | open Ast
    ^^^^^^^^
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "lib/riscv64/call_define.ml", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "lib/riscv64/call_define.ml", line 1, characters 0-13:
1 | let exit = 93
    ^^^^^^^^^^^^^
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)
File "lib/anf/anf_conv.ml", line 11, characters 2-6:
11 |   free := !free + 1;
       ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/anf/anf_conv.ml", line 11, characters 11-15:
11 |   free := !free + 1;
                ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/anf/anf_conv.ml", line 12, characters 3-7:
12 |   !free
        ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/anf/anf_conv.ml", line 16, characters 2-6:
16 |   free := 0;
       ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/anf/anf_conv.ml", line 17, characters 3-7:
17 |   !free
        ^^^^
Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.
File "lib/anf/anf_conv.mli", line 1:
Alert zanuda-linter:  First item in file should be a documentation comment with copyright information. For example:
            (** Copyright 2021-2022, Winnie Pooh et al. *)
File "lib/anf/anf_conv.mli", line 1, characters 0-11:
1 | open Ll_ast
    ^^^^^^^^^^^
Alert zanuda-linter: OCaml files should provide license information in second line (structure item)

@ioannessh ioannessh changed the title Slarn ml [D] Slarn ml Mar 24, 2025
@ioannessh ioannessh closed this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant