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

Handle ignored_columns from mixins #601

Merged

Conversation

tachyons
Copy link
Contributor

@tachyons tachyons commented Dec 25, 2021

Ignored columns can be added from a rails concern. In such cases, Rubocop fails with error as fetching table logic fails.

Before

Failure/Error:
       def_node_search :find_belongs_to, <<~PATTERN
         (send nil? :belongs_to {str sym} ...)
       PATTERN

     NoMethodError:
       undefined method `each_node' for nil:NilClass

Replace this text with a summary of the changes in your PR.
The more detailed you are, the better.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • 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.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • If this is a new cop, consider making a corresponding update to the Rails Style Guide.

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Would you like to add a changelog entry similar to this (all are removed during the release procedure) one? 3cae05d#diff-84b0e0ad32ba865c4f40649f0e502782883e4f0d90767d50e13d684bf9674c0d

@tachyons tachyons force-pushed the bugfix/handle_ignored_columns_from_mixins branch from 45b8b6a to 5864f06 Compare December 25, 2021 16:34
@tachyons
Copy link
Contributor Author

@pirj Just added one, Can you check if that is proper format ?

@tachyons tachyons force-pushed the bugfix/handle_ignored_columns_from_mixins branch from 5864f06 to acecdf9 Compare December 25, 2021 16:46
Before
```
Failure/Error:
       def_node_search :find_belongs_to, <<~PATTERN
         (send nil? :belongs_to {str sym} ...)
       PATTERN

     NoMethodError:
       undefined method `each_node' for nil:NilClass
```
@tachyons tachyons force-pushed the bugfix/handle_ignored_columns_from_mixins branch from acecdf9 to 3bc131f Compare December 26, 2021 14:08
@koic koic merged commit 1e9c257 into rubocop:master Dec 26, 2021
@koic
Copy link
Member

koic commented Dec 26, 2021

Thanks!

@tachyons tachyons deleted the bugfix/handle_ignored_columns_from_mixins branch December 27, 2021 03:42
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