-
Notifications
You must be signed in to change notification settings - Fork 66
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 Rubocop/Style 1 #20338
Merged
+82
−153
Merged
Fix Rubocop/Style 1 #20338
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0ac25f1
Fix Style/CollectionCompact
ryan-mcneil 655318c
Fix Style/ConcatArrayLiterals
ryan-mcneil 607b709
Fix Style/FetchEnvVar
ryan-mcneil cd97704
Fix Style/FileRead
ryan-mcneil 8bd82c7
Fix Style/FileWrite
ryan-mcneil 0a3059a
Remove Style/HashEachMethods
ryan-mcneil 3b6f3a4
Merge branch 'master' into rm-fix-rubocop-style-1
ryan-mcneil b45374a
update File stub values
ryan-mcneil cb6438e
Merge branch 'master' into rm-fix-rubocop-style-1
ryan-mcneil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,12 @@ namespace :mvi do | |
|
||
identity = UserIdentity.new( | ||
uuid:, | ||
first_name: ENV['first_name'], | ||
middle_name: ENV['middle_name'], | ||
last_name: ENV['last_name'], | ||
birth_date: ENV['birth_date'], | ||
gender: ENV['gender'], | ||
ssn: ENV['ssn'], | ||
first_name: ENV.fetch('first_name', nil), | ||
middle_name: ENV.fetch('middle_name', nil), | ||
last_name: ENV.fetch('last_name', nil), | ||
birth_date: ENV.fetch('birth_date', nil), | ||
gender: ENV.fetch('gender', nil), | ||
ssn: ENV.fetch('ssn', nil), | ||
email: '[email protected]', | ||
loa: { | ||
current: LOA::THREE, | ||
|
@@ -125,13 +125,13 @@ namespace :mvi do | |
|
||
desc "Given a ssn update a mocked user's correlation ids" | ||
task update_ids: :environment do | ||
ssn = ENV['ssn'] | ||
ssn = ENV.fetch('ssn', nil) | ||
raise ArgumentError, 'ssn is required, usage: `rake mvi:update_ids ssn=111223333 icn=abc123`' unless ssn | ||
|
||
ids = {} | ||
ids['icn'] = ENV['icn'] | ||
ids['edipi'] = ENV['edipi'] | ||
ids['participant_id'] = ENV['participant_id'] | ||
ids['icn'] = ENV.fetch('icn', nil) | ||
ids['edipi'] = ENV.fetch('edipi', nil) | ||
ids['participant_id'] = ENV.fetch('participant_id', nil) | ||
ids['mhv_ids'] = ENV['mhv_ids']&.split | ||
ids['vha_facility_ids'] = ENV['vha_facility_ids']&.split | ||
# 5343578988 | ||
|
@@ -145,7 +145,7 @@ namespace :mvi do | |
xml = yaml[:body].dup.prepend('<?xml version="1.0" encoding="UTF-8"?>') unless xml.match?(/^<\?xml/) | ||
|
||
yaml[:body] = update_ids(xml, ids) | ||
File.open(path, 'w') { |f| f.write(yaml.to_yaml) } | ||
File.write(path, yaml.to_yaml) | ||
|
||
puts 'ids updated!' | ||
end | ||
|
@@ -242,13 +242,13 @@ def create_cache_from_profile(cache_file, profile, template) | |
status: 200 | ||
} | ||
|
||
File.open(cache_file, 'w') { |f| f.write(response.to_yaml) } | ||
File.write(cache_file, response.to_yaml) | ||
end | ||
|
||
def valid_user_vars | ||
date_valid = validate_date(ENV['birth_date']) | ||
name_valid = ENV['first_name'] && ENV['middle_name'] && ENV['last_name'] | ||
attrs_valid = ENV['gender'] && ENV['ssn'] | ||
date_valid = validate_date(ENV.fetch('birth_date', nil)) | ||
name_valid = ENV.fetch('first_name', nil) && ENV.fetch('middle_name', nil) && ENV.fetch('last_name', nil) | ||
attrs_valid = ENV.fetch('gender', nil) && ENV.fetch('ssn', nil) | ||
date_valid && name_valid && attrs_valid | ||
end | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File methods don't specifically raise
TokenStorageError
, so I chose an error it could potentially raise (though it doesn't really matter).