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 Standard for Ruby formatting #397

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Add Standard for Ruby formatting #397

merged 1 commit into from
Jan 18, 2024

Conversation

derekprior
Copy link
Contributor

@derekprior derekprior commented Sep 29, 2023

We had been using Hound CI and a custom RuboCop config to encourage adhering to our style guide. In the last couple of years, Standard has emerged and gained steam as a "set it and forget it" RuboCop configuration for Ruby. Maintaining our own opinionated RuboCop configuration is not something I care to do any longer. This change:

  1. Adds Standard
  2. Fixes all1 of the issues it detects
  3. Adds Standard to CI
  4. Removes our hound and RuboCop configuration

Adding Standard as an explicit CI step will require compliance for passing builds, which is a departure from our previous setup of only commenting via Hound. I think the time is right for this change given the maturity of auto-fixers and integrations within various Ruby workflows.

Footnotes

  1. We continue to allow the use of eval in our specs

Gemfile Show resolved Hide resolved
Gemfile Show resolved Hide resolved
lib/generators/scenic/view/view_generator.rb Show resolved Hide resolved
lib/scenic/adapters/postgres/views.rb Show resolved Hide resolved
lib/scenic/adapters/postgres/views.rb Show resolved Hide resolved
lib/scenic/definition.rb Show resolved Hide resolved
lib/scenic/statements.rb Show resolved Hide resolved
lib/scenic/statements.rb Show resolved Hide resolved
@derekprior
Copy link
Contributor Author

Hound is still configured as a hook on this repo, which is why it ran on this PR with its default configuration (since I removed our configuration). I have resolved all of the comments and will remove the hound hook if we merge this.

lib/scenic/statements.rb Show resolved Hide resolved
spec/dummy/Rakefile Show resolved Hide resolved
spec/dummy/Rakefile Show resolved Hide resolved
spec/dummy/Rakefile Show resolved Hide resolved
spec/dummy/Rakefile Show resolved Hide resolved
spec/scenic/adapters/postgres_spec.rb Show resolved Hide resolved
spec/scenic/adapters/postgres_spec.rb Show resolved Hide resolved
@derekprior
Copy link
Contributor Author

Not 100% sure why I can't get standard to install correctly on CI. Will have to come back to it.

spec/scenic/command_recorder_spec.rb Show resolved Hide resolved
spec/scenic/command_recorder_spec.rb Show resolved Hide resolved
spec/scenic/command_recorder_spec.rb Show resolved Hide resolved
spec/scenic/command_recorder_spec.rb Show resolved Hide resolved
spec/scenic/command_recorder_spec.rb Show resolved Hide resolved
spec/scenic/schema_dumper_spec.rb Show resolved Hide resolved
spec/scenic/schema_dumper_spec.rb Show resolved Hide resolved
spec/scenic/schema_dumper_spec.rb Show resolved Hide resolved
spec/scenic/schema_dumper_spec.rb Show resolved Hide resolved
spec/scenic/schema_dumper_spec.rb Show resolved Hide resolved
spec/scenic/statements_spec.rb Show resolved Hide resolved
spec/scenic/statements_spec.rb Show resolved Hide resolved
spec/scenic/statements_spec.rb Show resolved Hide resolved
spec/support/generator_spec_setup.rb Show resolved Hide resolved
spec/support/generator_spec_setup.rb Show resolved Hide resolved
@derekprior
Copy link
Contributor Author

Whelp, got it working but it's not erroring on a violation I intentionally committed...

We had been using Hound CI and a custom RuboCop config to encourage
adhering to our style guide. In the last couple of years, Standard has
emerged and gained steam as a "set it and forget it" RuboCop
configuration for Ruby. Maintaining our own opinionated RuboCop
configuration is not something I care to do any longer. This change:

1. Adds Standard
2. Fixes all[^1] off the issues it detects
3. Adds Standard to CI
4. Removes our hound and RuboCop configuration

Adding Standard as an explicit CI step will require compliance for
passing builds, which is a departure from our previous setup of
only commenting via Hound. I think the time is right for this change
given the maturity of auto-fixers and integrations within various Ruby
workflows.

[^1]: We continue to allow the use of `eval` in our specs
@derekprior
Copy link
Contributor Author

This is working now, with annotations on failure. 🎉

@derekprior derekprior merged commit 4440870 into main Jan 18, 2024
9 checks passed
@derekprior derekprior deleted the dp-standard branch January 18, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant