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

[Fix #5188] Add --no-auto-gen-timestamp option #5358

Merged
merged 1 commit into from
Dec 30, 2017

Conversation

dominicsayers
Copy link
Contributor

@dominicsayers dominicsayers commented Dec 29, 2017

An option to generate a .rubocop_todo.yml file that does not change unless there are substantive changes to its content.

With this option and --no-offence-counts combined the .rubocop_todo.yml config should not change from run to run unless there are differences in the offences detected. This will allow developers to use automated git diff tests to check that the .rubocop_todo.yml is up-to-date.

In options.rb the verification of the presence of --auto-gen-config when any of the three associated options is supplied has been consolidated. This ensures that handling of these parameters is consistent, and as a nice side-effect it allows us to remove the args parameter from a chain of methods right up to define_options.


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.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run rake default or rake parallel. It executes all tests and RuboCop for itself, and generates the documentation.

@dominicsayers dominicsayers changed the title Add --no-auto-gen-timestamp option [Fix #5188] Add --no-auto-gen-timestamp option Dec 30, 2017
@@ -8,7 +8,7 @@ class DisabledConfigFormatter < BaseFormatter
HEADING =
['# This configuration was generated by',
'# `%s`',
"# on #{Time.now} using RuboCop version #{Version.version}.",
"# %susing RuboCop version #{Version.version}.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

New cop idea - string array followed by .join("\n") should be replaced with a heredoc. 😄

/cc @Drenmi @garettarrowood @pocke @koic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in most recent push

@bbatsov
Copy link
Collaborator

bbatsov commented Dec 30, 2017

Apart from the failed build, the changes look good to me.

@dominicsayers dominicsayers force-pushed the no-autogen-timestamp branch 2 times, most recently from 9b78c4f to cca2f9c Compare December 30, 2017 11:10
An option to generate a `.rubocop_todo.yml` file that does not change unless there are substantive changes to its content.

With this option and `--no-offence-counts` combined the `.rubocop_todo.yml` config should not change from run to run unless there are differences in the offences detected. This will allow developers to use automated `git diff` tests to check that the `.rubocop_todo.yml` is up-to-date.

In `options.rb` the verification of the presence of `--auto-gen-config` when any of the three associated options is supplied has been consolidated. This ensures that handling of these parameters is consistent, and as a nice side-effect it allows us to remove the `args` parameter from a chain of methods right up to `define_options`.
@bbatsov bbatsov merged commit 20c9966 into rubocop:master Dec 30, 2017
@bbatsov
Copy link
Collaborator

bbatsov commented Dec 30, 2017

👍

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