forked from openwebwork/webwork2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openwebwork#2317 from drgrice1/prettier
Add prettier formatting of JavaScript, style, and HTML files, and check formatting in a workflow.
- Loading branch information
Showing
37 changed files
with
2,395 additions
and
1,900 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.pg] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Check Formatting of Code Base | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
push: | ||
branches-ignore: [main, develop] | ||
pull_request: | ||
|
||
jobs: | ||
perltidy: | ||
name: Check Perl file formatting with perltidy | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: perl:5.34 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: cpanm -n Perl::Tidy@20220613 | ||
- name: Run perltidy | ||
shell: bash | ||
run: | | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
shopt -s extglob globstar nullglob | ||
perltidy --pro=./.perltidyrc -b -bext='/' ./**/*.p[lm] ./**/*.t && git diff --exit-code | ||
prettier: | ||
name: Check JavaScript, style, and HTML file formatting with prettier | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- name: Install Dependencies | ||
run: cd htdocs && npm ci --ignore-scripts | ||
- name: Check formatting with prettier | ||
run: cd htdocs && npm run prettier-check |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"arrowParens": "always", | ||
"bracketSpacing": true, | ||
"printWidth": 120, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.