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

Include config directory by default #105

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

koic
Copy link
Collaborator

@koic koic commented Apr 7, 2021

config directory contains files that user can write, such as application.rb, environments/*.rb, and so on.
Like #104, I think these are targets that should be detected offenses by default.

@toshimaru
Copy link
Owner

toshimaru commented Apr 10, 2021

The files auto-generated by rails new contain some rubocop offenses.

@koic Do you think these should be corrected after running rails new

prerequisite

  • rubocop-rails_config (1.3.4)
  • Rails (6.1.4)

Offenses

Offenses:

config/application.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
require_relative "boot"
^
config/boot.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
^
config/boot.rb:1:5: C: [Correctable] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
    ^^^^^^^^^^^^^^^^
config/boot.rb:1:44: C: [Correctable] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
                                           ^^^^^^^^^^^^
config/environment.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
# Load the Rails application.
^
config/puma.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
# Puma can serve each request in a thread from an internal thread pool.
^
config/routes.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
Rails.application.routes.draw do
^
config/spring.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
Spring.watch(

`config` directory contains files that user can write,
such as `application.rb`, `environments/*.rb`, and so on.
Like toshimaru#104, I think these are targets that should be detected
offenses by default.
@koic koic force-pushed the include_config_directory_by_default branch from e76e3fa to 2b47cf4 Compare April 12, 2021 03:30
@koic
Copy link
Collaborator Author

koic commented Apr 12, 2021

Yep, they look like issues to be solved at application layer after running rails new.

@toshimaru
Copy link
Owner

Okay, I ignored config directory since it's auto-generated by rails new, but let's leave this to those who maintain an application.

@toshimaru toshimaru merged commit f31be88 into toshimaru:main Apr 13, 2021
@koic koic deleted the include_config_directory_by_default branch April 13, 2021 00:30
@toshimaru
Copy link
Owner

Release v1.4.0 · toshimaru/rubocop-rails_config

v1.4.0 has been released with release discussion.

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.

2 participants