-
Notifications
You must be signed in to change notification settings - Fork 47
Bennaaym/labgraph monitor #60
Changes from all commits
2b94805
5b2cc11
80c42a9
a411e88
712a69b
7289e37
ac5d453
f1a115f
32c99de
2220577
377aed5
41de247
26c8022
a689772
033ee90
56327cb
203f52e
cc5529e
09598cf
b421b4a
b72e544
8e68cb5
1983088
0666023
538147a
3bb54ee
b3c97de
4739bd6
64c8342
5938270
3d2d640
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| on: [push] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [14.x] | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| cd extensions/prototypes/labgraph_monitor | ||
| yarn | ||
| - name: Run labgraph_monitor tests | ||
| run: | | ||
| cd extensions/prototypes/labgraph_monitor | ||
| yarn test --watchAll=false | ||
| yarn build |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| node_modules | ||
| public |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "extends": ["react-app", "react-app/jest", "prettier"], | ||
| "plugins": ["prettier"], | ||
| "rules": { | ||
| "prettier/prettier": [ | ||
| "error", | ||
| { | ||
| "endOfLine": "auto" | ||
| } | ||
| ], | ||
| "no-console": [ | ||
| "warn", | ||
| { | ||
| "allow": ["warn", "error"] | ||
| } | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
| cd ./extensions/prototypes/labgraph_monitor | ||
| SRC_PATTERN="extensions/prototypes/labgraph_monitor" | ||
| git diff --cached --name-only | if grep --quiet "$SRC_PATTERN" | ||
| then | ||
| yarn check-code | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| public | ||
| node_modules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "trailingComma": "es5", | ||
| "tabWidth": 4, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quick Question, is this tab width also consistent with the formatting on the Python side?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. currently, flake8 show a warning if the tab size isn't a multiple of 4 however the code can be always committed (that might need to be automated more). For typescript Airbnb guidelines suggest using 2 as tab size however I changed it to 4 to keep it consistent with Python. ref: 949ffc9 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I'm used to the Airbnb spec with 2, and probably most Front End contributors would be as well. However, if the repo wants to be consistent for both React and Python then yea I guess thats okay. |
||
| "semi": true, | ||
| "singleQuote": true, | ||
| "endOfLine": "auto" | ||
| } | ||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is .husky file a compulsory file for this commit?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I'm using prettier, eslint, husky to automate formatting, identifying patterns which keeps the code consistent and production-ready.
I believe that aligns with the approach that LabGraph is using with python by using flake8. The point of using husky is to automate the process through git-hooks, my current code will run a check whenever a contributor tries to add a new commit(pre-commit git-hook) that will prevent bad commits from being committed if there are any (e.g: unwanted console.log(), unused packages, unformatted code ...).
The husky script will run only if there is a change in the extensions/prototypes/labgraph_monitor directory.