Skip to main content

PyPI Python CI Python Lints codecov Codacy Badge

ufolint is a source file linter for typeface development in Unified Font Object (UFO) source code. It was designed for continuous integration testing of UFO source contributions to typeface projects.

The application performs a UFO version specific static analysis of the source text files against the UFO v2 and v3 specifications for issues that include:

  • supported UFO version
  • mandatory files and directories
  • mandatory file path naming conventions
  • source defined file path and directory path consistency across source files
  • valid XML file format
  • *.plist file property list value checks
  • *.plist file property list value type checks
  • fontinfo.plist OpenType property naming conventions
  • fontinfo.plist OpenType property data validations
  • *.glif file format version testing
  • *.glif file outline, attribute, anchor, guideline, image, note validations
  • images follow UFO v3+ png specification
  • source files import into ufoLib library with ufoLib public methods

These tests are performed through a combination of public methods in the fontTools.ufoLib library and additional tests that are implemented in the ufolint application. ufolint catches exceptions raised in the ufoLib public read methods for all _.plist file types and all ufoLib validations performed on _.glif files. These are returned to users with informative error messages that indicate the filepath(s) of concern and exit status code 1.

Install and Upgrade

ufolint can be run locally or with remote CI testing services.

Local Install and Upgrade

Use the command:

$ pip install ufolint

Upgrade to a new version of the application with the command:

$ pip install --upgrade ufolint

Local Usage

The process is fully automated. Simply point ufolint to one or more UFO source directories and it takes care of the rest. ufolint exits with status code 0 if all tests pass and exits with status code 1 if any tests fail.

$ ufolint [UFO source path] ([UFO path 2] [UFO path3]...)
Example
$ ufolint Awesome-Regular.ufo Awesome-Bold.ufo

For critical failures that prevent the completion of further testing, ufolint exits immediately and other tests are aborted. In all other circumstances, failures are collected across the entire analysis and displayed at the completion of all tests.

ufolint provides verbose, useful error messages that include the file(s) of concern, the error type, and in many cases, the problematic line in the file.

Travis CI Setup

To continuously test your UFO source changes on Travis with each commit pushed or pull request submitted to your Github repository, use these initial two steps from the Travis Getting Started Guide:

  • Step 1: Sign in to Travis with your Github account
  • Step 2: Go to your Travis Profile page and enable Travis for the typeface repository where you would like to enable ufolint testing

Then in your Github repository,

  • Step 3: Add a file on the path .travis.yml in the root of your Github repository that includes the following text:
.travis.yml
sudo: false
language: python

env:
  - VARIANT=src/Test-Regular.ufo
  - VARIANT=src/Test-Bold.ufo
  - VARIANT=src/Test-Italic.ufo
  - VARIANT=src/Test-BoldItalic.ufo

before_script: pip install ufolint

script: "ufolint $VARIANT"

notifications:
  email: false
  • Step 4: Replace the VARIANT=src/Test-*.ufo lines in the .travis.yml file with the actual paths to your UFO source files after the = character. Use one line per variant and add or subtract lines as necessary to test the desired source UFO directories in the repository. These should be relative paths from the root of your git repository.

This Travis setting structure performs the variant tests in parallel for each of the variants specified under the env field of the Travis settings file. Each variant will be labeled on the Travis testing page like this:

  • Step 5: With each new commit pushed to your Github repository (or any new pull request submitted by others) Travis is automatically notified and performs the ufolint tests on the modified (or proposed modifications for pull requests) UFO source. You can view the test results on your Travis account page for the repository.

  • Optional: To add a Travis test result badge to your repository README page, insert the following Markdown in your README page and modify [ACCOUNT] and [REPOSITORY] with your Travis account and repository details:

[![Build Status](https://travis-ci.org/[ACCOUNT]/[REPOSITORY].svg?branch=master)](https://travis-ci.org/[ACCOUNT]/[REPOSITORY])

Acknowledgments

Built with the fantastic fontTools ufoLib library where a majority of the UFO validation work has been performed!

License

MIT License

Metadata

Release files for ufolint 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ufolint 1.2.0
File Size Uploaded
ufolint-1.2.0.tar.gz 20.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ufolint 1.2.0
File Interpreter ABI Platform
ufolint-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.1 kB

Release files / ufolint-1.2.0.tar.gz

Download URL ufolint-1.2.0.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5578c2a17949b33e9a9d2d069849f7a83ca82b5f0a3d35bef8d24668be95bbe7
BLAKE2b-256 checksum
How to use checksums
9e221dd70f9be173482352dc9c3555af04bc5db19874b9568b360060fe492ff8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

Release files / ufolint-1.2.0-py3-none-any.whl

Download URL ufolint-1.2.0-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57344ade8141d3bbbd408225c5e0bf294fc0e1e4b76dc3efe133cd16b8af0adb
BLAKE2b-256 checksum
How to use checksums
7cdcfc8e82404c18d8cf8bb24f9b6f1dfc8d30c10dfa33d3da2631667ddd61c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page