Skip to content

Commit

Permalink
ci: fail if formatting is recommended (#660)
Browse files Browse the repository at this point in the history
Ask Linter to reformat the source code and fail if Linter suggests
changes. This means that the code should have been formatted differently
for the PR.

Something like this has already happened to me: the Linter failed
because of a single/double quotation mark when a double/single was
expected, then, I didn't receive any information and I didn't find
out what happened.

Signed-off-by: Claudio André <[email protected]>
  • Loading branch information
claudioandre-br committed Nov 27, 2024
1 parent b3067d3 commit 572a6c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ jobs:
ENABLE_COMMITLINT_STRICT_MODE: true
ENFORCE_COMMITLINT_CONFIGURATION_CHECK: true
FILTER_REGEX_EXCLUDE: "^/github/workspace/snapcraft.yaml$" # Workaround for Prettier itself
FIX_JAVASCRIPT_PRETTIER: true
FIX_JSON_PRETTIER: true
FIX_MARKDOWN_PRETTIER: true
FIX_YAML_PRETTIER: true
VALIDATE_GIT_MERGE_CONFLICT_MARKERS: false # See https://github.com/super-linter/super-linter/pull/6374
DEFAULT_BRANCH: "main"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check
run: |
echo "You should format source code properly!"
echo "**********************************************************************"
git diff
echo "**********************************************************************"
git diff --quiet

0 comments on commit 572a6c6

Please sign in to comment.