dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
240 stars 80 forks source link

Respect `excludedSourceFiles` when scanning sources #932

Closed chances closed 1 year ago

chances commented 1 year ago

My project interops with C and GLFW writes a lot of intermediate files with the *.d extension.

D-Scanner ought ignore files included in Dub's excludedSourceFiles.

WebFreak001 commented 1 year ago

D-Scanner is completely unrelated to DUB and this would be way out of scope, either specify the list of files you want to scan manually (e.g. using a shell script) or you could make a PR if you want some --exclude CLI argument that you can pass globs to ignore to.

e.g.

# this only lints the source directory
dscanner lint source/

# this only lints the files specified
dscanner lint source/app.d other/file.d and/folders/work/too/
WebFreak001 commented 1 year ago

I saw now in your PR that you probably want this with dub lint, in that case this is an issue on the DUB side that is invoking D-Scanner

chances commented 1 year ago

See https://github.com/dlang/dub/issues/2700.

Thank you for reporting this issue, @WebFreak001.

ricardaxel commented 12 months ago

D-Scanner is completely unrelated to DUB and this would be way out of scope, either specify the list of files you want to scan manually (e.g. using a shell script) or you could make a PR if you want some --exclude CLI argument that you can pass globs to ignore to.

e.g.

# this only lints the source directory
dscanner lint source/

# this only lints the files specified
dscanner lint source/app.d other/file.d and/folders/work/too/

@WebFreak001 Would you be still open to add an --exclude option to D-Scanner ? I could do the PR

WebFreak001 commented 12 months ago

sure that would be fine