Skip to content

Instantly share code, notes, and snippets.

@SamuelMwangiW
Last active January 13, 2024 14:58
Show Gist options
  • Select an option

  • Save SamuelMwangiW/d1ae4dae443cc395b64a34d4b6392107 to your computer and use it in GitHub Desktop.

Select an option

Save SamuelMwangiW/d1ae4dae443cc395b64a34d4b6392107 to your computer and use it in GitHub Desktop.
A Laravel pint config json and Github workflow to ensure every push is formated uniformly
name: Check & fix styling
on: [push]
permissions:
contents: write
jobs:
pint-fixer:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run Pint
run: ./vendor/bin/pint --test
# - name: Commit changes
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: Fix styling
{
"preset": "psr12",
"rules": {
"single_quote": {
"strings_containing_single_quote_chars": true
},
"blank_line_before_statement": {
"statements": [
"break",
"continue",
"declare",
"return",
"throw",
"try"
]
},
"declare_strict_types": true,
"not_operator_with_successor_space": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment