Skip to content

Conversation

RauliL
Copy link
Contributor

@RauliL RauliL commented May 3, 2018

Add support for configuration files, as described in this stub specification of sorts.

RauliL added 5 commits May 3, 2018 14:20
Introduce new configuration class which can parse configuration files in
YAML format, according to the stub specification defined in
https://github.com/andersinno/django-sanitized-dump/blob/c4ba725/README.md#example-config
Modify the CLI utility so that it supports reading configuration from a
file.
Add eggs into `.gitignore` as we do not want to store them in GitHub.
Instead of executable scripts, I was recommended to use `setup.cfg`
instead, so migrate from `setup.py` to `setup.cfg` instead.
Test (almost) every possible odd situation which might be encountered
during configuration parsing.
@RauliL RauliL requested a review from frwickst May 3, 2018 12:10
@codecov
Copy link

codecov bot commented May 3, 2018

Codecov Report

Merging #2 into master will increase coverage by 11.15%.
The diff coverage is 86.69%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master       #2       +/-   ##
===========================================
+ Coverage   70.76%   81.91%   +11.15%     
===========================================
  Files           6        8        +2     
  Lines         171      376      +205     
===========================================
+ Hits          121      308      +187     
- Misses         50       68       +18
Impacted Files Coverage Δ
database_sanitizer/__main__.py 0% <0%> (ø) ⬆️
database_sanitizer/tests/test_config.py 100% <100%> (ø)
database_sanitizer/dump/postgres.py 25% <33.33%> (-1.32%) ⬇️
database_sanitizer/dump/__init__.py 46.15% <50%> (ø) ⬆️
database_sanitizer/config.py 94.5% <94.5%> (ø)

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 7009230...994504c. Read the comment docs.

Main entry point of the package does not work properly, because it's
expected to be always callable. Convert contents of `__main__.py` into a
function and point into that function in `setup.cfg` to fix the issue.
Copy link
Contributor

@frwickst frwickst left a comment

Choose a reason for hiding this comment

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

Fantastic work! Could not find anything wrong with the code.

The only thing that reacted to was that the Configuration class was handling the sanitization. But I don't know of a better way to do it either and it is not like it is causing any problem. Just did not expect the config object to do the work as well as keep the config. I don't think this needs to be changed, just wanted to point that out.

image

@RauliL
Copy link
Contributor Author

RauliL commented May 3, 2018

Configuration is pretty much the only common thing available to all database backends, so it makes sense to me that the method which just calls the already imported sanitation functions should be located there.

@RauliL RauliL merged commit 1a329e6 into master May 3, 2018
@RauliL RauliL deleted the configuration branch May 3, 2018 12:39
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