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

New option: --external-css-file #35

Merged
merged 5 commits into from
Jan 30, 2016

Conversation

mgedmin
Copy link
Contributor

@mgedmin mgedmin commented Jan 26, 2016

Fixes #34.

This is a prototype that I expect to need to fix before it gets merged.

Missing bits:

  • diff-quality should probably also support --external-css-file
  • tests

I'm also not very fond of duplicating some CSS rules between external-style.css and snippet_style.html.

Test plan:

  • ran tox (tried detox, but your test suite doesn't support parallel execution due to writing to the same hardcoded filenames!)
  • installed it locally (virtualenv .venv && .venv/bin/pip install -e .)
  • ran .venv/bin/diff-cover coverage.xml --html /tmp/diff-cover.html --external-css /tmp/diff-cover.css
  • inspected /tmp/diff-cover.* with a text editor and tried it out in a browser

Fixes Bachmann1234#34.

Missing bits:
- diff-quality should probably also support --external-css-file
- tests

I'm also not very fond of duplicating some CSS rules between
external-style.css and snippet_style.html.
@mgedmin
Copy link
Contributor Author

mgedmin commented Jan 26, 2016

A hint about the best way to test this would be nice. test_integration.py perhaps, with a new call to self._check_html_report() and a new expected .html file in the fixtures directory/, while reusing an existing git diff fixture?

@Bachmann1234
Copy link
Owner

Testing in test integration is fine. The whole project is a pretty small flow. So I don't mind most of the tests being higher level.

One thing to keep in mind is that I recently changed it so the tests dont look at CSS. This is because pygments changes its CSS from time to time and I got tired of fixing the tests for that. So will need to think of some way of checking the correct css was applied. Simply checking one of your classes is there would likely be enough.

@mgedmin
Copy link
Contributor Author

mgedmin commented Jan 27, 2016

Pushed a test.

I don't know how I feel about adding this feature to diff-quality too. On the one hand, it feels lopsided to have two similar tools one of which can be used in Jenkins, and one can't. On the other hand, I've never actually used diff-quality, so my motivation is low, and I've no test plan.

Some gentle encouragement could help. ;)

@Bachmann1234
Copy link
Owner

@mgedmin Id certainly appreciate it. I mean you basically laid out the reasons.

The test plan and quite frankly the implementation would be fairly similar. In fact you are part of the way there best I could tell :-P

@mgedmin
Copy link
Contributor Author

mgedmin commented Jan 28, 2016

Test plan for diff-quality:

  • installed it locally (virtualenv .venv && .venv/bin/pip install -e . && .venv/bin/pip install flake8)
  • ran .venv/bin/diff-quality --violations flake8 --html /tmp/diff-cover.html --external-css /tmp/diff-cover.css
  • inspected /tmp/diff-cover.* with a text editor and tried it out in a browser
  • wrote integration test based on the one I made for diff-cover
  • ran tox

@Bachmann1234
Copy link
Owner

Ill review and likely merge this weekend. Release should be sometime in the next week or two as I am still hoping to get some feedback from people at edx about some major refactoring that happened

@Bachmann1234
Copy link
Owner

👍

Bachmann1234 added a commit that referenced this pull request Jan 30, 2016
New option: --external-css-file
@Bachmann1234 Bachmann1234 merged commit f3505a2 into Bachmann1234:master Jan 30, 2016
@Bachmann1234
Copy link
Owner

Ill release this in the next week or two. Feel free to harass me if I forget.

@mgedmin mgedmin deleted the external-css branch January 31, 2016 10:08
@Bachmann1234
Copy link
Owner

This is released! https://pypi.python.org/pypi/diff_cover/0.9.0

@Bachmann1234
Copy link
Owner

Thanks @mgedmin for the PR and the detailed info on the test plan :-)

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.

Option to use external CSS
2 participants