florianschanda / miss_hit

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

Non-existent directory listed under `exclude_dir` directive in config file causes miss_hit to error out #296

Closed rnwst closed 2 weeks ago

rnwst commented 2 weeks ago

MISS_HIT Component affected

MISS_HIT version: 0.9.43

Your operating system and Python version

Describe the bug If a directory is excluded in the config file via the exclude_dir directive, mh_style and mh_metric error out if that directory does not exist. This is a problem for our CI setup. In our miss_hit.cfg, we use the exclude_dir directive to ignore the contents of the works folder, which contains auto-generated code. This folder is also listed in our .gitignore, and is therefore not part of our project. Running mh_style on our individual development machines works fine, and the contents of the works folder are ignored for analysis. However, running mh_style on our CI machine causes it to error out every time, since the works folder is not present on a fresh checkout of the project repository.

If miss_hit cannot find a directory listed in miss_hit.cfg, it should simply continue and not exit with a non-zero exit code. If it must, it can print a warning, but I don't think that's necessary - after all git doesn't print a warning if it can't find a directory/file listed in .gitignore.

Remi-Gau commented 2 weeks ago

Double check but I think there is now an alternative config option for that use case.

See https://github.com/florianschanda/miss_hit/commit/5baaa4df3fda85e3813e303cc0ed797c5c28aeb0

rnwst commented 2 weeks ago

Excellent, thanks! For future reference, use ignore_dir instead of exclude_dir.

florianschanda commented 1 week ago

Thanks for closing this, I forgot to write here and do it myself ;)