Fix #457 - Allow to apply checks only for specific modules#460
Fix #457 - Allow to apply checks only for specific modules#4603 commits merged intodlang-community:masterfrom
Conversation
|
I have pushed this branch to If this gets merged into master, we could delete the "phobos" branch - though it might not be too bad to have a special branch for Phobos and thus being able to test features or apply workarounds without affecting the Dscanner. |
|
Can't you report and/or fix the problem in inifiled ? The library is quite small, should be doable. |
Yes, will do - just didn't had the time to reduce the bug and fix it when I was working on this PR. |
|
Thanks to @burner's fast feedback, merge & tagging, I could remove the workaround with the pseudo-variable and updated inifiled to 1.0.2 :) |
|
Huh? How is it possible that we have run AFAICT the only forward is to fix the makefile and build the libraries as static library separately. |
|
Thanks for your pull request, @wilzbach! |
The answer is simple: the previously checked-in version of Btw anything blocking this? |
|
I see that you referenced it. Actually i've approved two days ago and you could have merged at this time ! |
Thanks a lot. I didn't merge this because I prefer to avoid merging my own PRs and secondly because it's quite a non-trivial PR with some implications (changed test build, changed config file, ...). |
…ules (dlang-community#460) * Fix dlang-community#457 - Allow to apply checks only for specific modules * update inifiled to 1.0.2 * Compile dependencies separately, s.t. their unittests don't get executed
This (#457) would be very helpful for Phobos as it allows to introduce new checks gradually over time.
I discovered a dinifiled bug while developing this (the last variable always overwrites the according field in the main struct). However, as an easy workaround for now one can simply add a dummy variable at the end of the
.inifile.I think my idea is best explained by copy/pasting the the
READMEsection:Selecting modules for a specific check
It is possible to create a new section
analysis.config.ModuleFiltersin the.dscanner.ini.In this optional section a comma-separated list of inclusion and exclusion selectors can
be specified for every check on which selective filtering should be applied.
These given selectors match on the module name and partial matches (
std.or.foo.) are possible.Morover, every selectors must begin with either
+(inclusion) or-(exclusion).Exclusion selectors take precedence over all inclusion operators.
Of course, for every check a different selector set can given:
A few examples:
+std.: Includes all modules matchingstd.+std.bitmanip,+std.json: Applies the check only for these two modules-std.bitmanip,-std.json: Applies the check for all modules, but these two+.bar: Includes all modules matching.bar(e.g.foo.bar,a.b.c.barros)-etc.: Excludes all modules from.etc+std,-std.internal: Includes entirestd, except for the internal modulesCompatibility
I tried to develop this with backwards compatibility in mind as e.g. the following
With the proposed approach Dscanner will continue to work with existing configs and if users want to use this new feature, they can simply add a
[analysis.config.ModuleFilters]section to their config file.Enjoy!