-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from standardrb/clean-out-repo
Repo clean-up
- Loading branch information
Showing
12 changed files
with
59 additions
and
241 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,73 +2,77 @@ | |
|
||
A GitHub Action to run [StandardRB](https://github.com/standardrb/standard) against your code and create annotations in the GitHub UI. | ||
|
||
- [:white\_check\_mark: Standard Ruby Action](#white_check_mark-standard-ruby-action) | ||
- [:page\_facing\_up: Introduction](#page_facing_up-introduction) | ||
- [:bulb: Usage](#bulb-usage) | ||
- [:package: Example Workflow](#package-example-workflow) | ||
- [:warning: Gotchas](#warning-gotchas) | ||
- [:camera\_flash: Screenshots](#camera_flash-screenshots) | ||
- [:bookmark: Changelog](#bookmark-changelog) | ||
- [:sos: Contributing](#sos-contributing) | ||
- [:rotating\_light: Code of Conduct](#rotating_light-code-of-conduct) | ||
- [✨ Contributors](#-contributors) | ||
**[Status as of 6/17/2024: it's possible that the workflow may not work for most (or all) users. We're investigating.]** | ||
|
||
## :page_facing_up: Introduction | ||
## Usage | ||
|
||
GitHub Actions are an amazing new tool that can dramatically improve productivity while using the GitHub platform. While it is not hard to write a custom GitHub action to run StandardRB on your codebase, this action takes that functionality one step further using the checks API. After the StandardRB Linter Action runs StandardRB against your code, it will create annotations that you can easily view, matched up with the offending code. | ||
### Creating a Standard Ruby workflow: | ||
|
||
Since GitHub actions and the checks API are continually changing, it is possible that there will be breaking API changes that affect this action. If so, please open an issue and I will look into it as soon as I can. | ||
|
||
## :bulb: Usage | ||
|
||
Add the following to your GitHub action workflow to use StandardRB Linter Action: | ||
To separate Standard Ruby linting and formatting from your main test suite, you | ||
can add it in a standalone workflow: | ||
|
||
```yaml | ||
- name: StandardRB Linter | ||
uses: standardrb/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
USE_BUNDLE_VERSION: true # anything else (or omitting) will run the current version instead of your projects version | ||
``` | ||
### :package: Example Workflow | ||
Here is an example workflow file incorporating StandardRB Linter Action: | ||
```yaml | ||
name: StandardRB | ||
name: Standard Ruby | ||
on: [push] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: StandardRB Linter | ||
- name: Standard Ruby | ||
uses: standardrb/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
USE_BUNDLE_VERSION: true | ||
``` | ||
|
||
## :warning: Gotchas | ||
### Adding to an existing workflow: | ||
|
||
Due to the GitHub Check Runs API, we can only return 50 annotations per run. See [here](https://developer.github.com/v3/checks/runs/#output-object) for more info. | ||
You can add the following to your existing GitHub Action workflow: | ||
|
||
## :camera_flash: Screenshots | ||
```yaml | ||
- name: Standard Ruby | ||
uses: standardrb/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
USE_BUNDLE_VERSION: true | ||
``` | ||
|
||
![StandardRB Action Checks Overview](screenshots/check-overview.png) | ||
![StandardRB Action File Annotation](screenshots/file-annotation.png) | ||
This will require you to add these permissions (after specifying the operating system via `runs_on`): | ||
|
||
```yaml | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: read | ||
``` | ||
|
||
## Options | ||
|
||
These can be set under `env:` in the Standard Ruby action step. | ||
|
||
If you've installed the `standard` gem to your project with Bundler, then you | ||
probably want to run the same version in this action. Under the action, set: | ||
|
||
## :bookmark: Changelog | ||
```yaml | ||
USE_BUNDLE_VERSION: true | ||
``` | ||
|
||
[View our Changelog](/CHANGELOG.md) | ||
Omitting this value or setting it to anything else will instead execute | ||
`gem install standard` and run the latest version of Standard Ruby. | ||
|
||
## :sos: Contributing | ||
## Screenshots | ||
|
||
[Contributing Guide](/CONTRIBUTING.md) | ||
![StandardRB Action Checks Overview](screenshots/check-overview.png) | ||
![StandardRB Action File Annotation](screenshots/file-annotation.png) | ||
|
||
## :rotating_light: Code of Conduct | ||
## Code of Conduct | ||
|
||
This project follows Test Double's [code of | ||
conduct](https://testdouble.com/code-of-conduct) for all community interactions, | ||
|
@@ -77,18 +81,8 @@ code reviews, pull requests, and GitHub issues. If violations occur, Test Double | |
will take any action they deem appropriate for the infraction, up to and | ||
including blocking a user from the organization's repositories. | ||
|
||
## ✨ Contributors | ||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): | ||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
<!-- prettier-ignore --> | ||
<table> | ||
<tr> | ||
<td align="center"><a href="https://github.com/andrewmcodes/"><img src="https://avatars1.githubusercontent.com/u/18423853?v=4" width="100px;" alt="Andrew Mason"/><br /><sub><b>Andrew Mason</b></sub></a><br /><a href="#infra-andrewmcodes" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/andrewmcodes/standardrb-action/commits?author=andrewmcodes" title="Documentation">📖</a> <a href="https://github.com/andrewmcodes/standardrb-action/commits?author=andrewmcodes" title="Code">💻</a></td> | ||
</tr> | ||
</table> | ||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
## Acknowledgements | ||
|
||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! | ||
A big thanks to [Andrew Mason](https://github.com/andrewmcodes) for kicking off | ||
this project as | ||
[andrewmcodes/standardrb-acction](https://github.com/andrewmcodes/standardrb-action)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.