-
-
Notifications
You must be signed in to change notification settings - Fork 740
Apply Dscanner checks only to specific modules #5495
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
Changes from all commits
f77a768
43b33c6
5facd9b
ffc6ec5
3a13b12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -506,7 +506,6 @@ ${TOOLS_DIR}: | |
git clone --depth=1 ${GIT_HOME}/$(@F) $@ | ||
$(TOOLS_DIR)/checkwhitespace.d: | $(TOOLS_DIR) | ||
$(TOOLS_DIR)/styles/tests_extractor.d: | $(TOOLS_DIR) | ||
$(TOOLS_DIR)/styles/has_public_example.d: | $(TOOLS_DIR) | ||
|
||
#################### test for undesired white spaces ########################## | ||
CWS_TOCHECK = posix.mak win32.mak win64.mak osmodel.mak | ||
|
@@ -522,17 +521,17 @@ checkwhitespace: $(LIB) $(TOOLS_DIR)/checkwhitespace.d | |
############################# | ||
|
||
../dscanner: | ||
git clone https://github.com/Hackerpilot/Dscanner ../dscanner | ||
git -C ../dscanner checkout tags/v0.4.0 | ||
git clone https://github.com/dlang-community/Dscanner ../dscanner | ||
git -C ../dscanner checkout phobos | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a feature branch may interfere with editor/IDE Dscanner integrations, is this temporary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, my hope is that with by using this feature at Phobos, the approval of the [respective PR] at Dscanner gets sped up. However, considering that in the past I was often blocked due to slow response times, having our own branch to add unapproved features (and workarounds) might not be a bad idea. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have enabled force-push protection and a passing CI status requirement for |
||
git -C ../dscanner submodule update --init --recursive | ||
|
||
../dscanner/dsc: ../dscanner | ||
../dscanner/dsc: ../dscanner $(DMD) $(LIB) | ||
# debug build is faster, but disable 'missing import' messages (missing core from druntime) | ||
sed 's/dparse_verbose/StdLoggerDisableWarning/' ../dscanner/makefile > dscanner_makefile_tmp | ||
mv dscanner_makefile_tmp ../dscanner/makefile | ||
make -C ../dscanner githash debug | ||
DC=$(DMD) DFLAGS="$(DFLAGS) -defaultlib=$(LIB)" make -C ../dscanner githash debug | ||
|
||
style: has_public_example publictests style_lint | ||
style: publictests style_lint | ||
|
||
style_lint: ../dscanner/dsc $(LIB) | ||
@echo "Check for trailing whitespace" | ||
|
@@ -599,11 +598,6 @@ $(TEST_EXTRACTOR): $(TOOLS_DIR)/styles/tests_extractor.d $(LIB) | |
@$(TEST_EXTRACTOR) --inputdir $< --outputdir $(PUBLICTESTS_DIR) | ||
@$(DMD) $(DFLAGS) -defaultlib= -debuglib= $(LIB) -main -unittest -run $(PUBLICTESTS_DIR)/$(subst /,_,$<) | ||
|
||
has_public_example: $(LIB) | ||
# checks whether public function have public examples (for now some modules are excluded) | ||
rm -rf ./out | ||
DFLAGS="$(DFLAGS) $(LIB) $(LINKDL)" $(DUB) -v --compiler=$${PWD}/$(DMD) --root=../tools/styles -c has_public_example -- --inputdir std --ignore "array.d,allocator,base64.d,bitmanip.d,concurrency.d,conv.d,csv.d,datetime/date.d,datetime/interval.d,datetime/package.d,datetime/stopwatch.d,datetime/systime.d,datetime/timezone.d,demangle.d,digest/hmac.d,digest/sha.d,encoding.d,exception.d,file.d,format.d,getopt.d,index.d,internal,isemail.d,json.d,logger/core.d,logger/nulllogger.d,math.d,mathspecial.d,net/curl.d,numeric.d,parallelism.d,path.d,process.d,random.d,range,regex/package.d,socket.d,stdio.d,string.d,traits.d,typecons.d,uni.d,unittest.d,uri.d,utf.d,uuid.d,xml.d,zlib.d" | ||
|
||
.PHONY : auto-tester-build | ||
auto-tester-build: all checkwhitespace | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand + denotes a whitelist? Why not a blacklist?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
-
(blacklisting) is supported as well. The documentation isn't public yet, but it can be found e.g. here:https://github.com/dlang-community/D-Scanner/blob/d9df33a53f03dd0647316c64c848a8c214bb4a0d/README.md#selecting-modules-for-a-specific-check
I am a huge fan of using blacklists as well, I was just too lazy to generate a specific module blacklist list for every non-enabled check. However the
explicitly_annotated_unittests
check is an example of using blacklistsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be doable with Dustmite :)