miss_hit icon indicating copy to clipboard operation
miss_hit copied to clipboard

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

Open Remi-Gau opened this issue 3 years ago • 5 comments

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

  • MATLAB and Octave

MISS_HIT component affected

All

Remi-Gau avatar Oct 04 '21 09:10 Remi-Gau

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.

florianschanda avatar Oct 04 '21 10:10 florianschanda

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.

Remi-Gau avatar Oct 04 '21 10:10 Remi-Gau

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?

  • the core infrastructure lexer / parser / error handling mechanism is maybe the part with the best architecture, but it's also extremely fiddly
  • the other infrastructure (config mechanism and main driver) is large and a bit messy; there is some refactoring changes that could be a good start
  • then there is the various back-ends (i.e. the tools themselves); from these mh_style is by far the worst as the pretty printing of code is in desperate need of a fundamental re-write. There are also new tools that still need to be written; perhaps the most interesting one would be the octave/matlab compatibility check
  • and then there is the missing middle-end (semantic analysis), but I have no idea how to do this

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.

florianschanda avatar Oct 05 '21 06:10 florianschanda

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"

jmlarson1 avatar Jan 25 '23 18:01 jmlarson1

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

florianschanda avatar Feb 04 '23 13:02 florianschanda