Skip to content

Code Cleanup Report #23

Code Cleanup Report

Code Cleanup Report #23

name: Code Cleanup Report
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
unused-vars:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- fx-core
- server
- vscode-extension
- manifest
- api
- cli
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup legacy-peer-deps
run: |
npm config set legacy-peer-deps true
- name: Setup project
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 5
command: |
npm run setup
- name: Detect unused vars
run: npx eslint --no-eslintrc --rule '{@typescript-eslint/no-unused-vars:error}' --env browser,es6,node --parser-options ecmaVersion:2018 --parser-options sourceType:"module" --parser '@typescript-eslint/parser' --plugin "@typescript-eslint" src/**/*.ts
working-directory: packages/${{matrix.package}}
unused-exports:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- fx-core
- server
- vscode-extension
- manifest
- api
- cli
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install tools
run: npm install -g ts-unused-exports
- name: Detect unused exports
run: ts-unused-exports tsconfig.json --excludePathsFromReport=src/index.ts
working-directory: packages/${{matrix.package}}
missing-codeowners:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- fx-core
- server
- vscode-extension
- manifest
- api
- cli
steps:
- name: Checkout
uses: actions/checkout@v2
- run: |
npm install -g @snyk/github-codeowners
- name: Find files with no codeowners
run: |
files=$(github-codeowners audit -u -r packages/${{matrix.package}})
if [ -n "$files" ]; then
echo "The following files do not have an owner:"
echo "$files"
exit 1
else
echo "All files have an owner."
fi