johnnymorganz / stylua-action Goto Github PK
View Code? Open in Web Editor NEWGitHub action for StyLua
License: MIT License
GitHub action for StyLua
License: MIT License
When trying to pin to a stylua version 0.14.3
I get the error Could not find asset for v0.14.3 on platform linux
. I've tried it with and without strings, and I've also tried using v0.14.3
to no avail.
Currently we get the following warning when using stylua-action:
No version provided, or version provided is malformed, using latest release version. We recommend pinning the version explicitly to handle changes in formatting.
I assumed that this warning would go away when we explicitly pinned the version to latest
, but that didn't seem to work. Is this intended behaviour? If so, is there another way to disable the warning? We have considered the warning and have come to the conclusion that using the latest version is a risk we're willing to take, even if pinning the version is safer.
this is my workflow.yml
on:
push:
branches:
- main
jobs:
stylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: JohnnyMorganz/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --verify -g '*.lua' -g '*.iy' -- .
- uses: EndBug/add-and-commit@v9
with:
add: "."
committer_name: GitHub Actions
committer_email: [email protected]
it works if i run the command stylua --verify -g '*.lua' -g '*.iy' -- .
locally but not in GitHub actions
I was hoping to be able to write something like "version: ^0.17.1" in my workflow config to get behaviour slightly tighter than specifying "latest", but without having to update that config as often. Unfortunately that doesn't work. It looks like the reason is because the input is passed through semver.clean()
, which cleans a version number, not a range specifier.
> semver.clean(" 0.17")
null
> semver.clean(" 0.17.1")
'0.17.1'
> semver.clean("=0.17")
null
> semver.clean("=0.17.1")
'0.17.1'
> semver.clean(" ~0.17")
null
From my experimentation it looks like semver.satisfies()
is pretty tolerant of input variations (at least as tolerant as .clean()
), so I don't think any cleaning is necessary.
The documentation (README.md) says it follows semver syntax, which is what prompted me to think I could use a range specifier. If it's not your intent to allow version ranges, it'd be neat to have the README updated. I'd be happy to take a stab at the change if you want, but I'm not a TypeScript or JavaScript person so this is all pretty new to me.
Also it looks like the changes from 7b40065 didn't make it into the built code in dist/
, so the behaviour is still as before that change (which made searching for the error message in the source pretty confusing :))
Hi @JohnnyMorganz, My code is currently use label feature of lua, however it is not enabled by default in release version.
Are there anyway for me to enable features like lua52
when running this action?
Thank you for your great Stylua and this github action.
So now that we have the summary output style (thanks again!), it would be nice if the action used annotations to point out mistakes in the code.
This action became broken today with a strange error. Here is an example run I did on my configuration:
https://github.com/Shatur/neovim-config/actions/runs/3100298861/jobs/5020418947
I have the same error on my plugins.
It's possible to choose the latest commit by just specifying the main branch, but it'd be nice to have a way to point to the latest stable version. The official github actions does this by manually moving their v1
, v2
, v3
... tags to point to the latest stable versions (example). Another common way to do this is to use the git tag latest
if one doesn't want to mess with multiple versions.
Somewhat related: the @v1 in the README example doesn't work because there is no git tag "v1".
Hey there! We have quite a big repo and running StyLua on all the files on every commit takes quite a bit (20min), and I was wondering if you'd be open to adding a filter to only run on changed files, like reviewdog does here https://github.com/reviewdog/reviewdog#filter-mode
Hello, thanks for this extension.
I am in a situation where I need to install stylua so my test scripts can run it, but I don't want to run anything outside of it. Is it possible for this action to just install stylua without executing anything and just make stylua bin available?
i use simple congfig, but I can’t figure out how to return the formatted code to Github
name: Stylua check
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "rework" ]
pull_request:
branches: [ "rework" ]
jobs:
integration:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: stylua
uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest # NOTE: we recommend pinning to a specific version in case of formatting changes
args: -g '*.lua' -- .
run command give error. code 2
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.