-
Notifications
You must be signed in to change notification settings - Fork 213
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 generating todo when todo file already exists #587
Merged
searls
merged 10 commits into
standardrb:main
from
mrbiggred:bug/565-fix-generating-todo-when-todo-file-already-exists
Dec 4, 2023
Merged
Fix generating todo when todo file already exists #587
searls
merged 10 commits into
standardrb:main
from
mrbiggred:bug/565-fix-generating-todo-when-todo-file-already-exists
Dec 4, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit refactors the `builds_config.rb` file to handle generating a new todo file. It adds logic to not load the existing todo file when generating a new one, ensuring that the new todo file includes all necessary ignore rules from scratch.
…e rules. - Update `BuildsConfigTest` to remove the `test_todo_merged` method - Removed fixture "u" files.
This commit adds a new test case to ensure that the todo file is not loaded when generating the todo file.
- Refactored the code to use `unless` instead of checking if `argv` does not include "--generate-todo" - Refactored the test to remove unneeded expected value setup.
The commit adds a new test to check whether standardrb's '--generate-todo' generates the correct todo file.
New test case is introduced to validate the to-do list generation when one already exists. It ensures that existing errors will not obstruct the to-do list generation and will be duly reported.
- Refactored the before_setup method to include additional setup steps. - Updated the generate_todo_existing test to use a separate test folder and fixture folder for better organization. - Modified file paths in the generate_todo_existing test to reflect the new folder structure.
- Refactored the `test_generate_todo` and `test_generate_todo_existing` methods in the `StandardrbTest` class to use a new helper function called `assert_generate_todo`.
LGTM. Sorry for missing this prior |
Landed in 1.32.1 |
Thank you! |
Wow, that was fast. Thank for you for merging the fix and ping me if there are any issues now that it's merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #565 and should allow PR #176 to be closed. To duplicate the bug:
standardrb --generate-todo
on a project with some linting errors..standard_todo.yml
file to see what linting rules are ignored. For example:standardrb --generate-todo
a second time. Without this fix it would not list the existing linting rules in the old.standard_todo.yml
file. for example, the new file would NOT contain:The fix was to skip the loading of an existing
.standard_todo.yml
file generating the new one. Let me know what you think and if you have any feedback to improve this PR.