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

Contents.plist: use right exception when missing #87

Merged

Conversation

madig
Copy link
Contributor

@madig madig commented Dec 8, 2020

Need to figure out the tests. test_validators_plist_ufo2_contents_missing_file_fail and test_validators_plist_ufo3_contents_missing_file_fail don't actually test for failure?

@lgtm-com
Copy link

lgtm-com bot commented Dec 8, 2020

This pull request introduces 1 alert when merging 714519f into 51d1fe8 - view on LGTM.com

new alerts:

  • 1 for Wrong name for an argument in a class instantiation

@madig madig marked this pull request as ready for review December 8, 2020 12:43
@codecov
Copy link

codecov bot commented Dec 8, 2020

Codecov Report

Merging #87 (94d02fb) into master (51d1fe8) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
- Coverage   99.87%   99.87%   -0.01%     
==========================================
  Files          12       12              
  Lines         785      784       -1     
==========================================
- Hits          784      783       -1     
  Misses          1        1              
Impacted Files Coverage Δ
lib/ufolint/validators/plistvalidators.py 99.61% <100.00%> (-0.01%) ⬇️

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 51d1fe8...94d02fb. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Dec 8, 2020

This pull request introduces 1 alert when merging 94d02fb into 51d1fe8 - view on LGTM.com

new alerts:

  • 1 for Wrong name for an argument in a class instantiation

@madig
Copy link
Contributor Author

madig commented Dec 8, 2020

lgtm is somehow out of date with its dependencies?

str(rel_dir_path),
ufoFormatVersion=self.ufoversion,
validateRead=True,
expectContentsFile=True,
Copy link
Member

Choose a reason for hiding this comment

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

For (my) future reference, this is the new parameter that was added in fonttools v4.18.0

lib/ufolint/validators/plistvalidators.py Show resolved Hide resolved
@chrissimpkins
Copy link
Member

OK to ignore it. I'm not sure why it flags it but I can see that it was added in fonttools 4.18.0 and your unit tests are passing. This gtg?

@madig
Copy link
Contributor Author

madig commented Dec 8, 2020

Yes! If you sign off my changes to the existing tests? I found it odd that they tested for success when they should be expecting failure?

@chrissimpkins
Copy link
Member

Yes! If you sign off my changes to the existing tests? I found it odd that they tested for success when they should be expecting failure?

Running tests locally to have a look. I am seeing this message:

tests/test_runner.py: 17 warnings
/Users/chris/code/ufolint/.tox/py38/lib/python3.8/site-packages/ufolint/controllers/runner.py:356: DeprecationWarning: The 'formatVersion' attribute is deprecated; use the 'formatVersionTuple'
self.ufoversion = ufolib_reader.formatVersion

This going away soon?

@chrissimpkins
Copy link
Member

chrissimpkins commented Dec 8, 2020

If you sign off my changes to the existing tests?

LGTM. I think that this is a case of a missing test on a test :) Since it was not implemented in fonttools ufoLib and didn't raise an exception, I didn't recognize that my copy/paste code was not testing against the fail case. Bad source passed because there was previously no exception. It failed in the commit that included updated fonttools and ufolint source before the test changes were added (714519f): https://github.com/source-foundry/ufolint/runs/1517236056

@chrissimpkins
Copy link
Member

chrissimpkins commented Dec 8, 2020

Posted the deprecation issue in #88. We are ready to merge here. I will update the deprecated source. Thanks Niko!!


Update: deprecated source fixed and released in v1.2.0

@madig
Copy link
Contributor Author

madig commented Dec 8, 2020

This going away soon?

Mh, no idea, but should be easy to fix.

@madig
Copy link
Contributor Author

madig commented Dec 8, 2020

PS: can't merge so I'll leave that to you :D

@chrissimpkins
Copy link
Member

PS: can't merge so I'll leave that to you :D

Sorry, I think that the permission system changed since I last added people to this org. Or maybe it went away when I got rid of the tool team that auto added you and Cosimo as watch on any new repository. I didn't want force you to get pinged with all of the notifications.

I added you to a new "Maintainers" team and added this repo to it. I'll add the rest of the tool repos so that you have maintain level access to them if you need it.

@chrissimpkins chrissimpkins merged commit eedf001 into source-foundry:master Dec 8, 2020
@madig madig deleted the contents-plist-use-right-exception branch December 8, 2020 19:57
chrissimpkins added a commit that referenced this pull request Dec 8, 2020
@chrissimpkins
Copy link
Member

https://pypi.org/project/ufolint/1.2.0/

Thanks Niko!!

@chrissimpkins
Copy link
Member

chrissimpkins commented Dec 8, 2020

@felipesanches @graphicore we had to make the fonttools dependency a hard fonttools >= 4.18.0 in ufolint to introduce a new UFO source validation committed in this PR. This was released in v1.2.0. Is this a problem for fontbakery?

@graphicore
Copy link

I don't think there's a general problem, at least not in the way and context we use font bakery usually (virtual environments etc.). Similar things have been done before in Font Bakery, I see in setup.py:

    'fontTools[ufo,lxml,unicode]>=3.34',  # 3.34 fixed some CFF2 issues, including calcBounds

From the README of FontTools:

FontTools 4.x requires Python 3.6 or later. FontTools 3.x requires Python 2.7 or later.

Font Bakery is Python 3.6+ as well.

But, @felipesanches is the better person to answer this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants