Skip to content

Commit

Permalink
UI(linter, formatter): setup biome (#1287)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaAmega authored Sep 6, 2024
1 parent f0559e7 commit 4d83af5
Show file tree
Hide file tree
Showing 107 changed files with 1,554 additions and 4,430 deletions.
8 changes: 7 additions & 1 deletion .github/share-actions/ui-node-pnpm-install/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
name: UI install
inputs:
args:
type: string
description: ""
required: false
default: ""
runs:
using: "composite"
steps:
Expand All @@ -15,5 +21,5 @@ runs:

- name: 📥 Install node dependencies
working-directory: ui
run: pnpm i --frozen-lockfile --ignore-scripts
run: pnpm i --frozen-lockfile --ignore-scripts ${{ inputs.args }}
shell: bash
19 changes: 19 additions & 0 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ jobs:
echo "One or more evidently_python file(s) has changed."
echo "List all the files that have changed: ${{ steps.changed-files.outputs.evidently_python_all_changed_and_modified_files }}"
code-check:
name: UI code check
runs-on: ubuntu-22.04
needs: changed_files
if: ${{ github.event.pull_request.draft == false && (needs.changed_files.outputs.ui_any_modified == 'true' || needs.changed_files.outputs.evidently_python_any_modified == 'true') }}

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: 📥 Install ui dependencies
uses: ./.github/share-actions/ui-node-pnpm-install
with:
args: "-w"

- name: 🔬 Check code quality
working-directory: ui
run: pnpm code-check

ui-type-check:
name: UI type-check
runs-on: ubuntu-22.04
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ repos:
args: [--exit-non-zero-on-fix, --fix]
- id: ruff-format

# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: "v3.0.3"
# hooks:
# - id: prettier
- repo: https://github.com/biomejs/pre-commit
rev: "v0.4.0"
hooks:
- id: biome-ci
additional_dependencies: ["@biomejs/biome@1.8.3"]
53 changes: 53 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"files": {
// `endpoints.d.ts` is autogenerated
// `JsonParser.ts` copied from https://github.com/douglascrockford/JSON-js
"ignore": [
"ui/packages/evidently-ui-lib/src/**/JsonParser.ts",
"ui/packages/evidently-ui-lib/src/**/endpoints.d.ts",
"ui/packages/evidently-ui-lib/.tsc-dts/**"
],
"include": ["ui/*/src/**", "ui/packages/*/src/**"]
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"attributePosition": "auto"
},
"css": {
"linter": {
"enabled": true
},
"formatter": {
"enabled": true
}
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"jsxQuoteStyle": "single",
"quoteStyle": "single",
"quoteProperties": "asNeeded",
"semicolons": "asNeeded",
"trailingCommas": "none"
}
},
"json": {
"formatter": {
"trailingCommas": "none"
}
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
82 changes: 41 additions & 41 deletions src/evidently/nbextension/static/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/evidently/ui/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
content="Evidently - ML Monitoring Demo. Hosted example to monitor the performance of a demand forecasting model on a toy dataset."
/>
<title>Evidently - ML Monitoring Demo</title>
<script type="module" crossorigin src="/static/js/index-CKJqPvPP.js"></script>
<link rel="modulepreload" crossorigin href="/static/js/vendor-t0l2jWQ9.js">
<script type="module" crossorigin src="/static/js/index-NbS__BXi.js"></script>
<link rel="modulepreload" crossorigin href="/static/js/vendor-COAUpDWz.js">
<link rel="stylesheet" crossorigin href="/static/css/index-_rehp6Bp.css">
</head>
<body>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import{R as a,r as t}from"./vendor-COAUpDWz.js";const s=a.createContext(null),o=()=>t.useContext(s);export{s as D,o as u};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/evidently/ui/assets/static/js/index-BrZb1t9C.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/evidently/ui/assets/static/js/index-By5ZMnyu.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/evidently/ui/assets/static/js/index-CIEFkcKx.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/evidently/ui/assets/static/js/index-CKJqPvPP.js

This file was deleted.

1 change: 0 additions & 1 deletion src/evidently/ui/assets/static/js/index-CcLP2flX.js

This file was deleted.

1 change: 1 addition & 0 deletions src/evidently/ui/assets/static/js/index-DU-KQm24.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/evidently/ui/assets/static/js/index-DzU7Itgo.js

This file was deleted.

Loading

0 comments on commit 4d83af5

Please sign in to comment.