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 new config arguments_or_slashes to Rails/FilePath #298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tejasbubane
Copy link
Contributor

Config to just check for usage of File.path, but doesn't care about arguments to Rails.root.join


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • If this is a new cop, consider making a corresponding update to the Rails Style Guide.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@tejasbubane tejasbubane force-pushed the filepath-arguments-or-slashes-config branch from 50754c1 to 3677854 Compare July 20, 2020 18:12
@tejasbubane tejasbubane force-pushed the filepath-arguments-or-slashes-config branch 3 times, most recently from 8d86aec to cb548ae Compare July 25, 2020 18:20
@koic
Copy link
Member

koic commented Aug 1, 2020

I think the concept is good 👍 However I doubt the addition of the new parameter EnforcedStyle: arguments_or_slashes. I think this cop should probably be updated to accept multiple EnforcedStyle configuration using AllowMultipleStyles: true.

# .rubocop.yml
Rails/FilePath:
  EnforcedStyle:
    - slashes
    - arguments

Refer: rubocop/rubocop#6649

@tejasbubane tejasbubane force-pushed the filepath-arguments-or-slashes-config branch from cb548ae to ef6b7a6 Compare May 16, 2021 20:53
@tejasbubane tejasbubane force-pushed the filepath-arguments-or-slashes-config branch from ef6b7a6 to f27ca58 Compare May 16, 2021 20:55
@tejasbubane
Copy link
Contributor Author

@koic Looks like rubocop does not support multiple styles for EnforcedStyle yet - CI error.

@koic
Copy link
Member

koic commented May 17, 2021

Yup. About implementation should investigate the cause of the error and resolve it. I haven't reached the cause yet. AllowMultipleStyles provides new representation option for user, but it is a relatively new parameter and needs to be grown when something is missing.

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.

None yet

3 participants