emacs-elsa / Elsa

Emacs Lisp Static Analyzer and gradual type system.
GNU General Public License v3.0
640 stars 26 forks source link

Support multiple files passed on the command line #132

Closed vermiculus closed 5 years ago

vermiculus commented 5 years ago

Right now, I don't believe Elsa will check all the files given to it on the command line – at least not with just elsa-run.

https://github.com/emacs-elsa/Elsa/blob/9a2f3d5abfac44ab50aa9b6c34bbe8b9562741b1/elsa.el#L125-L131

We only check one file.

I'm hacking around this right now in vermiculus/emake.el#27, but it would be nice to not have to 😄

Fuco1 commented 5 years ago

Yea agreed. Shouldn't really be any more difficult than running that let* form once for each file.

Though elsa will actually read all the dependencies from require so if you target the main file it will find all the reachable code by itself. Only the output format isn't that great.

vermiculus commented 5 years ago

I can see if I can submit a patch sometime this week (possibly tonight). Does element in errors have some sort of record of where it was found?

Might be worthwhile to collect each error, sort, and remove duplicates before printing.

Fuco1 commented 5 years ago

There's more limitations, for example the state can not be shared between different files. I don't know why I didn't start with the multi-file model right away.

I think I store the file in the structure, you can see in elsa-errors.el.

Fuco1 commented 5 years ago

Actually I don't store the file because that is implicit when you call elsa-process-file. After that you get the state with the errors for that file.

So there won't be duplicate errors.