<commit_before>#! /usr/bin/env python

"""
A module for validating the the file structure of WOFF Files.
*validateFont* is the only public function.

This can also be used as a command line tool for validating WOFF files.
"""

"""
TO DO:
- merge metadata and table info from woff-info
- split length and offset tests into smaller functions that can be more easily doctested
- split testDirectoryBorders into smaller functions
- test for proper ordering of table data, metadata, private data
- test for overlapping tables
- check conformance levels of all tests
- for padding checks, compare the stored padding to \0, don't just
  test the edge for a remainder.
"""

"""
Testable Assertions (File Format):
http://dev.w3.org/webfonts/WOFF/spec/

#conform-private-last
#conform-diroverlap-reject
#conform-overlap-reject

#conform-metadata-extensionelements
#conform-metadata-extensions-optional
These contradict another requirement that says that the scheme MUST be followed.

#conform-nameoptional
Is this pointing to the right thing in the spec?

#conform-sameorder
#conform-identical
These can't be tested without access the original SNFT data.

#conform-metadata-encoding
This one is going to be complicated. Maybe someone on the list can help.

#conform-ascending-recreated
UA test.<commit_msg>Ordered my list of things to do.<commit_after>#! /usr/bin/env python

"""
A module for validating the the file structure of WOFF Files.
*validateFont* is the only public function.

This can also be used as a command line tool for validating WOFF files.
"""

"""
TO DO:
- add the missing tests from the testable assertions below
- test for proper ordering of table data, metadata, private data
- check conformance levels of all tests
- merge metadata and table info from woff-info
- split length and offset tests into smaller functions that can be more easily doctested
- split testDirectoryBorders into smaller functions
"""

"""
Testable Assertions (File Format):
http://dev.w3.org/webfonts/WOFF/spec/

#conform-private-last
#conform-diroverlap-reject
#conform-overlap-reject

#conform-metadata-extensionelements
#conform-metadata-extensions-optional
These contradict another requirement that says that the scheme MUST be followed.

#conform-nameoptional
Is this pointing to the right thing in the spec?

#conform-sameorder
#conform-identical
These can't be tested without access the original SNFT data.

#conform-metadata-encoding
This one is going to be complicated. Maybe someone on the list can help.

#conform-ascending-recreated
UA test.
{'fraction_non_alphanumeric': 0.06968503937007874, 'fraction_numerical': 0.0011811023622047244, 'mean_word_length': 4.596916299559472, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1339688', 'n_tokens_mistral': 714, 'n_tokens_neox': 696, 'n_words': 317}