-
Notifications
You must be signed in to change notification settings - Fork 32
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
[INFRA] set up miss_hit linter config and github action #58
Conversation
Sorry, I had missed the review request. One thing I am not sure about is moving the copyright text at the top of the file. None of Brainstorm, EEGLAB, FieldTrip or SPM does it. MATLAB doesn't but Octave does. When in Rome, do as the Romans... |
Yup as far as I know. https://florianschanda.github.io/miss_hit/style_checker.html
Will test option 1 and let you know. I am OK with option 2: where we put the copyright is something I clearly do not feel strongly about. :-) |
OK so option 1 makes miss_hit complain. So we can go with options 2 for now and silence that rule for now: will proceed if I get a 👍 |
👍 for that. I can see that you also add some indentation in some (but not all?) files in the |
I can see that you also add some indentation in some (but not all?) files in the Actually that one is going to be harder to circumvent as far as I know: see here
So the thing we can do is tweak the tab_width to waste less space, but the indentation on every line in functions seems to be a "must have" (it does make the code look more like python I agree). It is strange at first but I have set matlab to auto-indent stuff that way now, I would say that the headackes that miss_hit saves us on are worth the little "idiosyncrasy". I can set the tab-width to 2: that might make make thins more crammed but still readable. |
33486a6
to
4d72d59
Compare
Rebased and set the tab length to 2. Let me know what you think. :-) |
FYI: at the moment the linter ignore the source code and it is only applied to the test codebase. If we check the metrics of the rest of the code base that exceed the threshold set in the cfg with In brief: a little of refactoring ahead. Wooohooo !! 🚀 🎉 +bids/layout.m: metric: exceeded file_length: measured 673 > limit 600
In +bids/query.m, line 1
| function result = query(BIDS,query,varargin)
| ^^^^^ metric: exceeded cnest: measured 8 > limit 6
In +bids/query.m, line 1
| function result = query(BIDS,query,varargin)
| ^^^^^ metric: exceeded cyc: measured 43 > limit 20
In +bids/report.m, line 1
| function report(BIDS, Subj, Ses, Run, ReadNII)
| ^^^^^^ metric: exceeded cyc: measured 31 > limit 20
In +bids/+internal/file_utils.m, line 1
| function varargout = file_utils(str,varargin)
| ^^^^^^^^^^ metric: exceeded cyc: measured 21 > limit 20
In +bids/+util/tsvread.m, line 1
| function fileContent = tsvread(filename, fieldToReturn, hdr)
| ^^^^^^^ metric: exceeded cyc: measured 25 > limit 20
In +bids/+util/tsvwrite.m, line 1
| function tsvwrite(f, var)
| ^^^^^^^^ metric: exceeded cyc: measured 22 > limit 20
MISS_HIT Metric Summary: 18 file(s) analysed, 7 metric deviations(s) |
deae85b
to
e2a29b4
Compare
I have reset this and only kept the config file of the linter and the continuous integration to prevent any merge conflicts for now as the linter tends to change almost all the lines of our files for now. We'll clean things step by step as we go, PR by PR and only for the files changed in a given PR or before the creation of a first release. |
97158a6
to
98ab8de
Compare
56191c4
to
926b97f
Compare
lint files that are not involved in another PR<-- left out for later to prevent merge conflicts headaches.For now the rules concerning functions, classes and methods names are ignored.