Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,61 @@ jobs:

- run: yarn lint-ci

- name: Save linting context for CodeCoach
run: echo "ESLINT_CONTEXT=$(pwd)" >> $GITHUB_ENV

- name: Save eslint-report.json
uses: actions/upload-artifact@v3
with:
name: eslint-report
path: eslint-report.json
retention-days: 1

- run: yarn test --ci

- run: yarn build

codecoach:
needs: npm-build
runs-on: ubuntu-latest
container: encx/codecoach-cli

steps:
- uses: actions/checkout@v3

- name: Restore eslint-report.json
uses: actions/download-artifact@v3
with:
name: eslint-report
path: .

- name: CodeCoach
run: |
cat << EOF > codecoach.json
{
"vcs": "github",
"githubRepoUrl": "${{ github.server_url }}/${{ github.repository }}",
"githubPr": "${{ github.event.pull_request.number }}",
"githubToken": "${{ github.token }}",
"buildLogFile": [
"eslint;eslint-report.json;${ESLINT_CONTEXT}"
],
"removeOldComment": true,
"output": "output.json"
}
EOF

codecoach --config="codecoach.json"

- name: Save CodeCoach debug info
uses: actions/upload-artifact@v3
with:
name: codecoach-debug
path: |
eslint-report.json
output.json
debug.log

docker-build:
name: "docker: Build"
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
dist/
node_modules/
*.log
eslint-report.json

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"scripts": {
"lint": "eslint 'src/**/*.{js,ts}' --quiet --fix",
"lint-ci": "eslint 'src/**/*.{js,ts}'",
"lint-ci": "eslint 'src/**/*.{js,ts}' -f json -o eslint-report.json || true",
"format": "prettier --write 'src/**/*.{js,ts}'",
"test": "jest",
"build": "tsc --project tsconfig.build.json",
Expand Down
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class App {
configs.githubPr,
);
return new GitHubAdapter(githubPRService);
} else if (configs.vcs === 'gitlab') {
} else if (configs.vcs == "gitlab") {
return new GitLabAdapter(new GitLabMRService());
}
}
Expand All @@ -63,7 +63,7 @@ class App {
case ProjectType.msbuild:
return new MSBuildParser(cwd);
case ProjectType.tslint:
return new TSLintParser(cwd);
return new TSLintParser(cwd)
case ProjectType.eslint:
return new ESLintParser(cwd);
case ProjectType.scalastyle:
Expand Down