Skip to content

Commit 6a51265

Browse files
authored
Merge pull request #2412 from NCEAS/feature-2096-linting-formatting
Apply linting & formatting globally
2 parents 59466ab + ab3cfda commit 6a51265

File tree

441 files changed

+120702
-105426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

441 files changed

+120702
-105426
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
99
liberapay: # Replace with a single Liberapay username
1010
issuehunt: # Replace with a single IssueHunt username
1111
otechie: # Replace with a single Otechie username
12-
custom: ['https://giving.ucsb.edu/Funds/Give?id=353]
12+
custom: ["https://giving.ucsb.edu/Funds/Give?id=353"]
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: ""
55
labels: bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for MetacatUI
4-
title: ''
4+
title: ""
55
labels: enhancement
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Describe the feature you'd like**
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Format, Lint, & Test"
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- reopened
7+
- synchronize
8+
branches-ignore:
9+
- ignore-*
10+
jobs:
11+
run_checks:
12+
name: Run All Checks
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
steps:
18+
- name: Check out code
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: "18"
26+
- name: Install dependencies
27+
run: npm install
28+
- name: Check for linting errors on changed code
29+
uses: reviewdog/action-eslint@v1
30+
if: always()
31+
with:
32+
github_token: "${{ secrets.GITHUB_TOKEN }}"
33+
reporter: github-pr-review
34+
eslint_flags: src
35+
filter_mode: diff_context
36+
fail_on_error: true
37+
- name: Check for formatting errors on changed code
38+
uses: EPMatt/reviewdog-action-prettier@v1
39+
if: always()
40+
with:
41+
github_token: "${{ secrets.GITHUB_TOKEN }}"
42+
reporter: github-pr-review
43+
filter_mode: diff_context
44+
fail_on_error: true
45+
- name: Ensure unit tests pass
46+
id: test
47+
if: always()
48+
run: npm test
49+
- name: Ensure docs build without errors
50+
id: jsdoc-dry-run
51+
if: always()
52+
run: npm run jsdoc-dry-run

.github/workflows/test.js.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Prettier doesn't format underscore.js templates correctly
2+
src/**/*.html
3+
# Don't modify third-party code
4+
src/components
5+
# docs/docs is auto-generated
6+
docs/docs
7+
# Ignore any minimized files
8+
**/*.min.*

.prettierrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"plugins": ["@shopify/prettier-plugin-liquid"],
3+
"overrides": [
4+
{
5+
"files": "docs/_includes/*.html",
6+
"options": {
7+
"parser": "liquid-html"
8+
}
9+
},
10+
{
11+
"files": "docs/_layouts/*.html",
12+
"options": {
13+
"parser": "liquid-html"
14+
}
15+
}
16+
]
17+
}

0 commit comments

Comments
 (0)