Lightweight code review tool. Provide lint output to CodeCoach, it will automatically review pull requests. CodeCoach uses node.js as run time. It can be run from any command line. So it can be integrated with any CI with ease.
- ESLint
- TSLint
- MSBuild (both
msbuild.exe
anddotnet build
commands) - ScalaStyle
- AndroidLint
- DartLint
- GitHub
- GitHub Enterprise
Node.js v14 or later
Install it globally using npm
$ npm i -g codecoach
or Yarn
$ yarn global add codecoach
Use command codecoach
with required config.
Example
$ codecoach --url="https://github.com/codeleague/codecoach" --pr=99 --token="token1234567890token" -f="eslint;/path/to/eslintoutput/json"
config codecoach via yml format file. example, a config argument will override this configuration
Repository url
PR number to review
Repository access token. For GitHub, it's "Personal access tokens" in settings.
Build log content files config. Splitted in to 3 part, formatted in <type>;<path>[;<cwd>]
- Type: one of
dotnetbuild
,msbuild
,tslint
,eslint
,scalastyle
,androidlint
ordartlint
- Path: Path to lint output file to be processed
- cwd: Repository root directory for lint context (optional, will use current context if not provided)
For example,
Case 1: Run CodeCoach from repo root for eslint
and dotnetbuild
in the same lint context directory
--buildLogFile="eslint;./src/client/eslint-out.json" --buildLogFile="dotnetbuild;./src/api/msbuild.log"
Case 2: Run CodeCoach from somewhere else for androidlint
(linter context is /path/to/project/root
)
--buildLogFile="androidlint;./android-lint.xml;/path/to/project/root"
Parsed lint result output.
Remove existing CodeCoach comments before putting the new one in.
Use -o <filename>
to output lint result to file and -f json
to format logs as JSON.
(ref.)
Use -o <filename>
to output lint result to file and -t json
or --format json
to format logs as JSON.
(ref.)
Use -fileLoggerParameters
or -flp
switch with msbuild
, dotnet build
or dotnet msbuild
command to send logs to file.
(ref.)
Result is already written to target/scalastyle-result.xml
when project is built
(ref.)
Use -o <filename>
to output lint result to file
(ref.)
Use -o <filename>
on output lint result created by command dart analyze > <filename>
in dart project
(ref.)
For contribution guidelines and project dev setup. Please see CONTRIBUTING.md