Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rubocop and GitHub Actions to plugin generator #51822

Merged
merged 1 commit into from
May 23, 2024

Conversation

excid3
Copy link
Contributor

@excid3 excid3 commented May 14, 2024

Motivation / Background

As I was working on my RailsConf 2024 talk, I realized the Rails plugin generator had not been updated to include the new rubocop and GitHub Actions files that ship with the app generator. These are particularly useful for plugin developers to make it easier to get started.

I spoke briefly with @rafaelfranca about making these additions which he agreed was a good idea. I also asked about brakeman, but he said that didn't make sense.

Detail

This Pull Request updates the plugin generator to include templates for GitHub Actions and rubocop. It also updated a couple of files to ensure they pass the rubocop linting.

I have kept these templates separate from the app templates as they are likely to diverge slightly over time.

Additional information

I decided not to include any functionality for testing CI against multiple Rails versions, but this could be added in the future.
Same for testing multiple Ruby versions. This could be added later.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the railties label May 14, 2024
@rafaelfranca rafaelfranca force-pushed the plugin-github-actions branch 2 times, most recently from a616634 to 5b26ff5 Compare May 14, 2024 18:56
@MatheusRich
Copy link
Contributor

Overall looks good. Do we need a CHANGELOG entry and docs for this?

@excid3
Copy link
Contributor Author

excid3 commented May 15, 2024

Just saw @andrewn617 had refactored the database functionality for the app generator 2 days ago, so this is now updated and tests pass @rafaelfranca. There is one random failure in actioncable that seems unrelated.

@zzak
Copy link
Member

zzak commented May 18, 2024

Overall looks good. Do we need a CHANGELOG entry and docs for this?

Could you squash your commits too when you're ready please? 🙇

When creating new Rails plugins, rubocop and GitHub Actions are now
included to make linting and testing easier.
@rafaelfranca rafaelfranca merged commit c906f75 into rails:main May 23, 2024
3 checks passed
rafaelfranca added a commit that referenced this pull request May 23, 2024
Add rubocop and GitHub Actions to plugin generator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants