Skip to content

feat: Add local/global configuration support#254

Merged
camilamaia merged 4 commits intomasterfrom
configuration-file
Aug 24, 2020
Merged

feat: Add local/global configuration support#254
camilamaia merged 4 commits intomasterfrom
configuration-file

Conversation

@camilamaia
Copy link
Copy Markdown
Member

@camilamaia camilamaia commented Aug 23, 2020

Initial support for a different configuration filename and global configuration.

Created on top of: #225

closes #203
closes #131

@camilamaia camilamaia changed the title Configuration file feat: Add local/global configuration support for #203. #225 Aug 23, 2020
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 23, 2020

Codecov Report

Merging #254 into master will increase coverage by 0.01%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #254      +/-   ##
==========================================
+ Coverage   93.48%   93.49%   +0.01%     
==========================================
  Files          19       19              
  Lines         583      584       +1     
==========================================
+ Hits          545      546       +1     
  Misses         38       38              
Impacted Files Coverage Δ
scanapi/config_loader.py 92.30% <ø> (+2.65%) ⬆️
scanapi/settings.py 96.96% <93.33%> (-3.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9433751...867a13a. Read the comment docs.

@camilamaia camilamaia force-pushed the configuration-file branch 2 times, most recently from 867a13a to e4aa2e8 Compare August 23, 2020 17:33
@camilamaia camilamaia changed the title feat: Add local/global configuration support for #203. #225 feat: Add local/global configuration support Aug 23, 2020
@camilamaia camilamaia force-pushed the configuration-file branch 2 times, most recently from 973ac55 to aba4a4a Compare August 23, 2020 18:35
@camilamaia camilamaia marked this pull request as ready for review August 23, 2020 18:37
@camilamaia camilamaia requested review from a team as code owners August 23, 2020 18:37
@camilamaia
Copy link
Copy Markdown
Member Author

@supakeen hey, I added the missing tests! Would you mind to review it? Thank you very much!!

Comment thread scanapi/config_loader.py
extension = os.path.splitext(file_path)[-1]

if extension not in (".yaml", ".yml", ".json"):
raise FileFormatNotSupportedError(extension, file_path)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi, @camilamaia! Good work on this PR 🚀 I have just a little question... How is the FileFormatNotSupportedError handled now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@gillianomenezes we are simply not checking the extension anymore... if pyaml cant convert it, then we will have an exception. Maybe it would be nice to check if this is handled properly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've updated it with the suggestion :)

Copy link
Copy Markdown
Contributor

@gillianomenezes gillianomenezes left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

@camilamaia camilamaia force-pushed the configuration-file branch 3 times, most recently from fd98978 to 5cb603f Compare August 24, 2020 20:21
@camilamaia camilamaia merged commit 1639a88 into master Aug 24, 2020
@camilamaia camilamaia deleted the configuration-file branch August 24, 2020 20:34
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.

Change config file default name Refactor Settings Tests to mock file opening

4 participants