Once you have node 8.x in your machine, install sonar
:
npm install -g @sonarwhal/sonar
Create a .sonarrc
file by running this command and following the
instructions:
sonar --init
Scan a website:
sonar https://example.com
You can find more information in the online user guide, or the local version for the most recent (and unstable) content.
To know more about the internals of sonar
, how to create new
rules, collectors, formatters, etc, take a look at the online
developer guide (or
the local version.
The following are meant only if you are working on sonar
's codebase:
npm run site <url>
will analyze the website with the current configuration and using the latest build available in thedist
directory.npm run site -- --debug <url>
same as above, but will show all the debug information.npm run lint
will lint the code.npm run watch
will start watchmode. This is the recommended task to run in the background while developing. It does the following:- sync all the resources from
src
todist
(basically anything that is not a.ts
file). - compile the typescript files incrementally to
dist
. - run all the tests incrementally.
- sync all the resources from
npm run build
will do the same as thewatch
task but only once and without running the tests.npm test
will run the tests with code coverage using the code available indist
. It is better to run this task afterbuild
.
The initialization of the watch
task is a bit especial: it will
compile and copy the assets before starting to watch for new files
to copy, build, or test. Because of concurrency, it might be that
the tests are run twice initially.
This project adheres to the JS Foundation's code of conduct. By participating in this project you agree to abide by its terms.
The code is available under the Apache 2.0 license.