-
Notifications
You must be signed in to change notification settings - Fork 20
support ruff mode argument #19
support ruff mode argument #19
Conversation
Users can now specify the mode of ruff to be 'check' or 'format' using the mode input.
aede224
to
17a2e52
Compare
@yosmoc -- thanks! Looking at this now. A question: mode means lots of things in different contexts. Is there an alternate, more narrowly descriptive word that would be possible to use? Mode might be acceptable, but wanting to spend a moment to consider alternatives. Please advise thoughts. |
Thanks. How about these alternatives?
|
README.md
Outdated
- src: default, '.' | ||
|
||
```yaml | ||
- uses: chartboost/ruff-action@v1 | ||
with: | ||
src: "./src" | ||
mode: "check" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the default is check, why would we include that in the example? Wouldn't users keep it blank since to check it wouldn't need to be specified?
@yosmoc -- looking a bit closer: is there a reason the existing |
@brucearctor Sure! If we provide an example of |
This reverts commit 17a2e52.
@brucearctor I reverted my original commit and updated the README file. Would you please check it again? |
```yaml | ||
- uses: chartboost/ruff-action@v1 | ||
with: | ||
args: 'format --check' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
Are you sure people would want to use format --check
[ see docs from link/screenshot ] ... I imagine generally want to use either format or check [ or even format followed by check ]? Otherwise -- and I haven't tested -- is the failure message sufficiently easy to debug?
I'm fine with this, if you think correct, but please think through. If wanting format --check
, maybe we link to the doc or make the failure code clear to help people with potential debugging? Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ... maybe I missed the development. ruff formatter is different than linter! So, ruff format --check, is checking that the file is formatted. In this case, formatter is roughly a replacement for black? If that's correct, then indeed this makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe was confusing 'format' with 'fix' option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Ruff formatter is replacement for black. The Ruff Formatter - Ruff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you put a little not in the docs as part of your PR about that? I imagine - since I got confused others might as well? Otherwise, we're great to go.
Related: #11
This PR allows Users to specify the mode of ruff to be 'check' or 'format' using the mode input.