aglipanci / laravel-pint-action Goto Github PK
View Code? Open in Web Editor NEWGitHub Action for Laravel Pint
Home Page: https://laravel.com/docs/master/pint
GitHub Action for Laravel Pint
Home Page: https://laravel.com/docs/master/pint
When setting up this action, I expected the onlyDirty: true
argument to only format changed files in the PR, since this is a fairly common use case for linting. However, it did not format anything, because all changes are already committed, and that is how Pint works.
I propose adding an option onlyChanged
that would only format the files changed in the PR/commit. This was referenced in #5 (comment), and a workaround was given, to use another action to format only changed files. However, using the get all changed files action, I don't see any way that I would pass a list of files to format to Pint.
Have a look at this article, maybe it helps:
michaelheap.com/semantic-versioning-for-github-actions
github.com/creating-actions/about-custom-actions#using-tags-for-release
- Create a release on a release branch (such as release/v1, release/1) before creating the release tag (for example, v1.0.2).
- Move the major version tag (v1, v2, etc.) to point to the Git ref of the current release. For more information, see "Git basics - tagging."
According to the documentation there should be tags for major releases(like aglipanci/laravel-pint-action@2
)
major release tag must be updated on every new minor release(must point to latest)
Using major release tag helps keep the pint action updated, without having to modify yml in each minor release(latest)
git-scm.com/v2/Git-Basics-Tagging
To tag a commit, you specify the commit checksum (or part of it) at the end of the command:
git tag -a 2 859b17c
Where 859b17c it's the current release
All other "github actions" use major version tags, for example github.com/actions/checkout/tags:
Related #13
Please don't ignore it, it just a tag, easy to fix it
Is it possible for the pint to only the files which are modified in a PR and NOT all the project files?
Currently, we have a dirty project and we can not transform the whole code base in a large PR.
So we want to migrate gradually.
i'm having issue with runing pint in vscode
when i run
./vendor/bin/pint
it add all my projects file as changes when i check them there's no change on the file. why is that ?
also is there a possible config to check only the file that i have worked on not all the project ?
Action ignore any changes from pint.json
in root directory.
is posible just set mayor version?
Like
uses: aglipanci/laravel-pint-action@2
or
uses: aglipanci/laravel-pint-action@v2
Recently, GitHub introduced free macOS runners that run on Apple Silicon. I am now getting the following error:
Error: Container action is only supported on Linux
It would be nice if this script could be allowed to run on Apple Silicon as well, perhaps making it even faster :)
Thanks!
The latest version of Pint 1.3.0
introduced some breaking changes, following the update to PHP CS Fixer 3.13.1
.
For now we really need to stay on Pint 1.2.*
as to not "fixing" a vast majority of files that are perfectly fine.
Current tag v2
doesn't point at the latest v2 tag (2.4
)
The output command is as follows.
[Pint/pint] [DEBUG] Started container: c41969f571c43fbc5cd1d31f8ff9a4c74b63abd409f6c06d0669f6edcfc3e8f0
| Running Command: composer global require laravel/pint:1.13 --no-progress --dev
| Changed current directory to /tmp
| The "1.13" constraint for "laravel/pint" appears too strict and will likely not match what you want. See https://getcomposer.org/constraints
| ./composer.json has been created
| Running composer update laravel/pint
| Loading composer repositories with package information
| Updating dependencies
| Lock file operations: 1 install, 0 updates, 0 removals
| - Locking laravel/pint (v1.13.0)
| Writing lock file
| Installing dependencies from lock file (including require-dev)
| Package operations: 1 install, 0 updates, 0 removals
| - Downloading laravel/pint (v1.13.0)
| - Installing laravel/pint (v1.13.0): Extracting archive
| Generating autoload files
| No security vulnerability advisories found.
| Running Command: pint --test -v --config laravel/pint.json --preset laravel
The script I want output is pint --test -v --config laravel/pint.json --preset laravel --dirty
.
Is there a solution?
โMy Scripts
name: Pint
on:
pull_request:
paths:
- '**.php'
jobs:
pint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# with:
# ref: ${{ github.head_ref }}
# token: "${{ secrets.GITHUB_TOKEN }}"
- name: Apply Pint
uses: aglipanci/[email protected]
with:
preset: laravel
configPath: "laravel/pint.json"
pintVersion: 1.13
verboseMode: true
testMode: true
onlyDirty: true
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.