florianschanda / miss_hit

MATLAB Independent, Small & Safe, High Integrity Tools - code formatter and more
GNU General Public License v3.0
158 stars 21 forks source link

Can `Exclude: "directory"` behavore more like `.gitignore` ? #234

Open Remi-Gau opened 2 years ago

Remi-Gau commented 2 years ago

What kind of feature is this?

It might happen that I use some folders or repositories (for example to run tests) that I want MH to ignore. So I add them in the config. But those are usually not version controlled and might lead to MH errors in CI or when someone else clones the repo.

Describe the solution you'd like

Could it be possible for the "exclude" behavior of MH more "tolerant" and resemble more that of .gitignore where files or folders whether they exist or not ?

If this is too much of a pain to set up, don't worry: I can live without this. :wink:

Your MATLAB/Octave environment

MISS_HIT component affected

All

florianschanda commented 2 years ago

I've re-written the config system from scratch once already, because it was a glorious hard-to-read and hard-to-write mess; and it's still the same pile of nasty garbage ;)

This, and the ticket about wild-card excludes, etc. may be enough to make me re-write it for a third time.

Basically, this is harder than it should be for reasons I only have to blame myself for. But if I do this I might do something like offering two modes: fail on error, and ignore silently; I see a use for both.

Remi-Gau commented 2 years ago

that'd be great but no rush for me on this

also if I can do more to help than opening issues, let me know. Have never dived into the code base but let me know if that can help with the bus factor of the project.

florianschanda commented 2 years ago

Help is always appreciated :)

So there are no open tickets with the difficulty: low label; but I can maybe review the whole list again and add it.

Documentation of the code is... meh at best but maybe if you're super interested we can maybe organise a code walk-through at some point. Also depends largely on which area you're interested in helping out?

There is some additional Python / scaleability considerations that make this more exciting. Specifically the code is multi-threaded; and so far it is pretty sensible (as each file can be dealt with in isolation). However I intend to also multi-thread the symbol resolution and semantic analysis, which as far as I am aware has not been done before (and may very well be worthy of a minor tool paper somewhere). The main reason I want to do this is speed: when looking at a million-line code base doing things sequentially in Python takes a (too) long time.

And finally, the grammar and lexical structure of my interpretation of MATLAB needs to be written down, along with a compatibility test suite to be executed in MATLAB. This would be the first step anyway toward making any steps towards tool qualification.

And of course there is always documentation that could be improved. These patches and changes would also be quite welcome.

jmlarson1 commented 1 year ago

Somewhat related to this issue: is it possible to exclude a directory "further down" than the project_root location?

This seems valid: exclude_dir: "dir" but this is not: exclude_dir: "dir/subdir"

florianschanda commented 1 year ago

You can, but you need to place a .miss_hit file in the directory just above, i.e. dir/.miss_hitand exclude subdir there/