Skip to content

How do you show the line number and character location of a lint error occuring #185

@wu-s-john

Description

@wu-s-john

I greatly appreciate you guys for making the effort to build an ocaml linter. It would be nice if I can know the exact location of the linting issues occurring. For example, I ran the toy example in the toy example in the a paper that you guys wrote. This is the expected output:

$ ocp - lint --path tools /ocp - lint --disable -plugin - typedtree
Summary :
* 11 files were linted
* 40 warnings were emitted :
* 2 " interface_missing " number 1
* 2 " code_length " number 1
* 4 " ocp_indent " number 1
File " lint_input . ml " , line 1:
" ocp_indent " number 1:
File lint_input .ml ’ is not
indented correctly .
File " lint_actions . ml " , line 1:
" code_length " number 1:
This line is too long ( ’82 ’) : it
should be at most of size
’80 ’.
File " main . ml " , line 1:
" interface_missing " number 1:
Missing interface for main .ml ’. 

However, I get the following output when I run the exact commands in my computer.

Scanning files in project "tools/ocp-lint"...
Found '60' file(s)
Running analyses... 60 / 60
Merging database...
== New Warnings ==
  * 22 file(s) were linted
  * 368 warning(s) were emitted:
    * 243 warning(s) raised by "plugin_parsing"
      * 20 warning(s) raised by "get_features.1"/warning #1
      * 223 warning(s) raised by "check_tuple.1"/warning #1
    * 125 warning(s) raised by "plugin_parsetree"
      * 14 warning(s) raised by "pattern_guard.1"/warning #1
      * 13 warning(s) raised by "type_declaration.1"/warning #1
      * 98 warning(s) raised by "polymorphic_variants.1"/warning #1
  * 2 file(s) couldn't be linted

This does not tell me where the pattern_guard issue is occurring. Which file is this issue occurring in? Can you guys take a look at this?

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