From b2b5ee5a224a71591ab44eed916dc614aff313e0 Mon Sep 17 00:00:00 2001 From: Fabien Basmaison Date: Sat, 17 Apr 2021 12:39:57 +0200 Subject: [PATCH 1/2] [lint] Tweak editorconfig and frontend lint: - Ignore computer generated files when linting. - Include .mo files for consistency. - Use multiline yaml syntax for `run` commands. --- .editorconfig | 9 +++++++-- .github/workflows/lint-frontend.yaml | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 58ba190d..bad9b712 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,9 +20,10 @@ block_comment_end = */ [{bw-dev,fr-dev,LICENSE}] max_line_length = off -[*.{csv,json,html,md,po,py,svg,tsv}] +[*.{csv,json,html,md,mo,po,py,svg,tsv}] max_line_length = off +# ` ` at the end of a line is a line-break in markdown [*.{md,markdown}] trim_trailing_whitespace = false @@ -30,7 +31,11 @@ trim_trailing_whitespace = false indent_size = 2 max_line_length = off -[{package.json,yarn.lock}] +# Computer generated files +[{package.json,*.lock}] indent_size = unset indent_style = unset max_line_length = unset + +[*.mo] +insert_final_newline = unset diff --git a/.github/workflows/lint-frontend.yaml b/.github/workflows/lint-frontend.yaml index f370d83b..54cac04d 100644 --- a/.github/workflows/lint-frontend.yaml +++ b/.github/workflows/lint-frontend.yaml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-20.04 steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. - uses: actions/checkout@v2 - name: Install modules @@ -26,8 +26,13 @@ jobs: # See .stylelintignore for files that are not linted. - name: Run stylelint - run: yarn stylelint bookwyrm/static/**/*.css --report-needless-disables --report-invalid-scope-disables + run: > + yarn stylelint bookwyrm/static/**/*.css \ + --report-needless-disables \ + --report-invalid-scope-disables # See .eslintignore for files that are not linted. - name: Run ESLint - run: yarn eslint bookwyrm/static --ext .js,.jsx,.ts,.tsx + run: > + yarn eslint bookwyrm/static \ + --ext .js,.jsx,.ts,.tsx From 21fcd5c854ad5b9cb37a6cee14e14b34894b80f0 Mon Sep 17 00:00:00 2001 From: Fabien Basmaison Date: Sat, 17 Apr 2021 20:49:27 +0200 Subject: [PATCH 2/2] [editorconfig] Regroup computer generated rules. --- .editorconfig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index bad9b712..d102bc5a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,7 +20,7 @@ block_comment_end = */ [{bw-dev,fr-dev,LICENSE}] max_line_length = off -[*.{csv,json,html,md,mo,po,py,svg,tsv}] +[*.{csv,json,html,md,po,py,svg,tsv}] max_line_length = off # ` ` at the end of a line is a line-break in markdown @@ -32,10 +32,8 @@ indent_size = 2 max_line_length = off # Computer generated files -[{package.json,*.lock}] +[{package.json,*.lock,*.mo}] indent_size = unset indent_style = unset max_line_length = unset - -[*.mo] insert_final_newline = unset