dub lint

Christian Köstlin christian.koestlin at gmail.com
Thu Sep 15 23:14:37 UTC 2022


On 16.09.22 00:14, Ali Çehreli wrote:
> On 9/15/22 15:04, Ali Çehreli wrote:
> 
>  > Is there a way to silence specific 'dub lint' warnings?
> 
> Answering myself, I don't think it's possible but luckily my catching an 
> Error was in unittests only so I can do either of the following to skip 
> unittest code when linting:
> 
> a) Pass --skipTests to dscanner (what 'dub lint' runs behind the scenes) 
> along with --styleCheck, which --skipTests requires
> 
>    dub lint -- --skipTests --styleCheck
> 
> b) Pass --styleCheck indirectly through 'dub lint', which has its own 
> spelling for it :), but --skipTests is still required of course:
> 
>    dub lint --style-check -- --skipTests
> 
> Ali
> 
There is `dub run dscanner -- --defaultConfig` which creates a default 
config in `~/.config/dscanner/dscanner.ini` (for linux and osx). There 
one can disable only the checks for bad exception handling
```
; Check for poor exception handling practices
exception_check="disabled"
```
and then its possible to move this file e.g. to the project folder and 
use in with `dub lint --config=dscanner.ini` ...
interestingly `dub lint --help` shows two different options for `--config`:

```
dub lint --help
USAGE: dub lint [<package>[@<version-spec>]] [<options...>] [-- 
<application arguments...>]
..
..
       --config=VALUE    Use the given configuration file.
..
..
   -c  --config=VALUE    Builds the specified configuration.
..
..

```

Kind regards,
Christian




More information about the Digitalmars-d-learn mailing list