Skip to content

Commit

Permalink
[CI] Add prettier to pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jbampton committed Nov 5, 2024
1 parent ff2e675 commit c363dc9
Show file tree
Hide file tree
Showing 17 changed files with 291 additions and 250 deletions.
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: 'github-actions' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: "daily"
interval: 'daily'
12 changes: 6 additions & 6 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install dependencies
run: sudo apt-get install build-essential

- name: "GCC Version"
- name: 'GCC Version'
run: |
gcc --version
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: "GCC Version"
- name: 'GCC Version'
run: |
gcc --version
Expand All @@ -61,7 +61,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: "GCC Version"
- name: 'GCC Version'
run: |
gcc --version
Expand Down Expand Up @@ -195,9 +195,9 @@ jobs:
- name: Create new GitHub Release and Tag
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ env.VERSION }}"
name: "Salam Release v${{ env.VERSION }}"
body: "This release includes the latest build for Linux, macOS, and Windows."
tag_name: 'v${{ env.VERSION }}'
name: 'Salam Release v${{ env.VERSION }}'
body: 'This release includes the latest build for Linux, macOS, and Windows.'
files: |
release/salam-linux
release/salam-mac
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/first_interaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ jobs:
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Thank you for your interest in Salam language! We appreciate you opening your first issue. Contributions like yours help make Salam language better."
pr-message: "Welcome and thank you for your first pull request! We appreciate your contribution to Salam language. Your code changes will be reviewed shortly."
issue-message: 'Thank you for your interest in Salam language! We appreciate you opening your first issue. Contributions like yours help make Salam language better.'
pr-message: 'Welcome and thank you for your first pull request! We appreciate your contribution to Salam language. Your code changes will be reviewed shortly.'
8 changes: 4 additions & 4 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ name: Lint

on: [pull_request]

permissions: # added using https://github.com/step-security/secure-workflows
permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
build:
permissions:
contents: read # for actions/checkout to fetch code
statuses: write # for super-linter/super-linter/slim to mark status of each linter run
contents: read # for actions/checkout to fetch code
statuses: write # for super-linter/super-linter/slim to mark status of each linter run
name: Super-Linter
runs-on: ubuntu-latest
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )'
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ name: Test

on: [pull_request]

permissions: # added using https://github.com/step-security/secure-workflows
permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
pre-commit:
name: Run pre-commit # https://pre-commit.com/
name: Run pre-commit # https://pre-commit.com/
runs-on: ubuntu-latest
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )'
uses: actions/checkout@v4
- uses: actions/setup-python@v5 # https://www.python.org/
- uses: actions/setup-python@v5 # https://www.python.org/
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies # https://pip.pypa.io/en/stable/
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies # https://pip.pypa.io/en/stable/
run: |
python -m pip install --upgrade pip
pip install pre-commit
Expand All @@ -30,8 +30,8 @@ jobs:
run: pre-commit run --all-files
test-git-clone:
timeout-minutes: 10
name: "Test git clone on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
name: 'Test git clone on ${{ matrix.os }}'
runs-on: '${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
Expand All @@ -45,7 +45,7 @@ jobs:
- {os: windows-latest}
- {os: windows-2019}
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )'
uses: actions/checkout@v4
with:
fetch-depth: 0
21 changes: 17 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@ default_stages: [commit, push]
default_language_version:
# force all unspecified Python hooks to run python3
python: python3
node: 22.2.0
minimum_pre_commit_version: '3.2.0'
repos:
- repo: meta
hooks:
- id: identity
- id: check-hooks-apply
name: check hooks apply to the repository
- repo: local
hooks:
- id: prettier
name: run prettier
description: format files with prettier
entry: prettier --write .
files: \.(css|html|md|ya?ml)$
language: node
additional_dependencies: ['prettier@3.3.3']
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
Expand All @@ -18,6 +29,7 @@ repos:
rev: v8.20.1
hooks:
- id: gitleaks
name: detect hardcoded secrets
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand Down Expand Up @@ -53,12 +65,13 @@ repos:
rev: v3.12.2
hooks:
- id: markdown-link-check
name: markdown link check
args: [-q]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
name: Run markdownlint
name: run markdownlint
description: Check Markdown files with markdownlint
args: [--config=.github/linters/.markdown-lint.yml]
types: [markdown]
Expand All @@ -67,12 +80,12 @@ repos:
rev: v9.1.2
hooks:
- id: oxipng
args: ["-o", "4", "--strip", "safe", "--alpha"]
args: ['-o', '4', '--strip', 'safe', '--alpha']
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
name: Run yamllint
name: run yamllint
description: Check YAML files with yamllint
args: [--strict, -c=.github/linters/.yaml-lint.yml]
exclude: ^config/layout/attribute/style/value\.yaml$
Expand All @@ -82,5 +95,5 @@ repos:
rev: v19.1.3
hooks:
- id: clang-format
args: ["--style=file"]
args: ['--style=file']
files: \.(c|h)$
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore artifacts:
build
config/layout/attribute/style/value.yaml
coverage
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"singleQuote": true
"bracketSpacing": false,
"singleQuote": true
}
2 changes: 1 addition & 1 deletion config/layout/attribute/style/state.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
items:
- id: AST_LAYOUT_ATTRIBUTE_STYLE_STATE_TYPE_ERROR
- id: AST_LAYOUT_ATTRIBUTE_STYLE_STATE_TYPE_GLOBAL
generate_name: "*"
generate_name: '*'
text:
en: global
fa: سراسری
Expand Down
Loading

0 comments on commit c363dc9

Please sign in to comment.