Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Remi-Gau opened this issue Oct 4, 2021 · 5 comments
Open

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

Remi-Gau opened this issue Oct 4, 2021 · 5 comments
Labels
component: core Affects the core infrastructure difficulty: high This change will be tricky or large

Comments

@Remi-Gau
Copy link
Contributor

Remi-Gau commented Oct 4, 2021

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. 😉

Your MATLAB/Octave environment

  • MATLAB and Octave

MISS_HIT component affected

All

@florianschanda
Copy link
Owner

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 florianschanda added component: core Affects the core infrastructure difficulty: high This change will be tricky or large labels Oct 4, 2021
@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Oct 4, 2021

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
Copy link
Owner

florianschanda commented Oct 5, 2021

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.

@jmlarson1
Copy link

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core Affects the core infrastructure difficulty: high This change will be tricky or large
Projects
None yet
Development

No branches or pull requests

3 participants