<img src ="https://raw.githubusercontent.com/source-foundry/ufolint/images/images/title-header-crunch.png" />
[![PyPI](https://img.shields.io/pypi/v/ufolint?color=blueviolet&label=PyPI&logo=python&logoColor=white)](https://pypi.org/project/ufolint)
![Python CI](https://github.com/source-foundry/ufolint/workflows/Python%20CI/badge.svg)
![Python Lints](https://github.com/source-foundry/ufolint/workflows/Python%20Lints/badge.svg)
[![codecov](https://codecov.io/gh/source-foundry/ufolint/branch/master/graph/badge.svg)](https://codecov.io/gh/source-foundry/ufolint)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/53663b1c61874ebb8b3022ee9945f5c8)](https://app.codacy.com/app/SourceFoundry/ufolint)
ufolint is a source file linter for typeface development in [Unified Font Object](http://unifiedfontobject.org/) (UFO) source code. It was designed for continuous integration testing of UFO source contributions to typeface projects.
<p align="center">
<img src="https://raw.githubusercontent.com/source-foundry/ufolint/images/images/ufolint_example.gif"/>
</p>
<p align="center">
<img src ="https://raw.githubusercontent.com/source-foundry/ufolint/images/images/ufolint_travis_example-crunch.png" />
</p>
The application performs a UFO version specific static analysis of the source text files against the [UFO v2 and v3 specifications](http://unifiedfontobject.org/) 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](https://github.com/fonttools/fonttools/tree/master/Lib/fontTools/ufoLib) 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](https://travis-ci.org) with each commit pushed or pull request submitted to your Github repository, use these initial two steps from the [Travis Getting Started Guide](https://docs.travis-ci.com/user/getting-started/):
- **Step 1**: [Sign in to Travis](https://travis-ci.org/auth) with your Github account
- **Step 2**: Go to your [Travis Profile page](https://travis-ci.org/profile) 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
```yaml
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:
<p align="center">
<img src ="https://raw.githubusercontent.com/source-foundry/ufolint/images/images/parallel_ufolint_jobs-crunch.png" />
</p>
- **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](https://github.com/fonttools/fonttools) where a majority of the UFO validation work has been performed!
## License
[MIT License](https://github.com/source-foundry/ufolint/blob/master/docs/LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/source-foundry/ufolint",
"name": "ufolint",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6.0",
"maintainer_email": "",
"keywords": "",
"author": "Christopher Simpkins",
"author_email": "chris@sourcefoundry.org",
"download_url": "https://files.pythonhosted.org/packages/9e/22/1dd70f9be173482352dc9c3555af04bc5db19874b9568b360060fe492ff8/ufolint-1.2.0.tar.gz",
"platform": "any",
"description": "<img src =\"https://raw.githubusercontent.com/source-foundry/ufolint/images/images/title-header-crunch.png\" />\n\n[![PyPI](https://img.shields.io/pypi/v/ufolint?color=blueviolet&label=PyPI&logo=python&logoColor=white)](https://pypi.org/project/ufolint)\n![Python CI](https://github.com/source-foundry/ufolint/workflows/Python%20CI/badge.svg)\n![Python Lints](https://github.com/source-foundry/ufolint/workflows/Python%20Lints/badge.svg)\n[![codecov](https://codecov.io/gh/source-foundry/ufolint/branch/master/graph/badge.svg)](https://codecov.io/gh/source-foundry/ufolint)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/53663b1c61874ebb8b3022ee9945f5c8)](https://app.codacy.com/app/SourceFoundry/ufolint)\n\nufolint is a source file linter for typeface development in [Unified Font Object](http://unifiedfontobject.org/) (UFO) source code. It was designed for continuous integration testing of UFO source contributions to typeface projects.\n\n<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/source-foundry/ufolint/images/images/ufolint_example.gif\"/>\n</p>\n\n<p align=\"center\">\n <img src =\"https://raw.githubusercontent.com/source-foundry/ufolint/images/images/ufolint_travis_example-crunch.png\" />\n</p>\n\nThe application performs a UFO version specific static analysis of the source text files against the [UFO v2 and v3 specifications](http://unifiedfontobject.org/) for issues that include:\n\n- supported UFO version\n- mandatory files and directories\n- mandatory file path naming conventions\n- source defined file path and directory path consistency across source files\n- valid XML file format\n- \\*.plist file property list value checks\n- \\*.plist file property list value type checks\n- fontinfo.plist OpenType property naming conventions\n- fontinfo.plist OpenType property data validations\n- \\*.glif file format version testing\n- \\*.glif file outline, attribute, anchor, guideline, image, note validations\n- images follow UFO v3+ png specification\n- source files import into ufoLib library with ufoLib public methods\n\nThese tests are performed through a combination of public methods in the [fontTools.ufoLib library](https://github.com/fonttools/fonttools/tree/master/Lib/fontTools/ufoLib) 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.\n\n# Install and Upgrade\n\nufolint can be run locally or with remote CI testing services.\n\n## Local Install and Upgrade\n\nUse the command:\n\n```\n$ pip install ufolint\n```\n\nUpgrade to a new version of the application with the command:\n\n```\n$ pip install --upgrade ufolint\n```\n\n## Local Usage\n\nThe 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.\n\n```\n$ ufolint [UFO source path] ([UFO path 2] [UFO path3]...)\n```\n\n##### Example\n\n```\n$ ufolint Awesome-Regular.ufo Awesome-Bold.ufo\n```\n\nFor 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.\n\nufolint 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.\n\n## Travis CI Setup\n\nTo continuously test your UFO source changes on [Travis](https://travis-ci.org) with each commit pushed or pull request submitted to your Github repository, use these initial two steps from the [Travis Getting Started Guide](https://docs.travis-ci.com/user/getting-started/):\n\n- **Step 1**: [Sign in to Travis](https://travis-ci.org/auth) with your Github account\n- **Step 2**: Go to your [Travis Profile page](https://travis-ci.org/profile) and enable Travis for the typeface repository where you would like to enable ufolint testing\n\nThen in your Github repository,\n\n- **Step 3**: Add a file on the path `.travis.yml` in the root of your Github repository that includes the following text:\n\n##### .travis.yml\n\n```yaml\nsudo: false\nlanguage: python\n\nenv:\n - VARIANT=src/Test-Regular.ufo\n - VARIANT=src/Test-Bold.ufo\n - VARIANT=src/Test-Italic.ufo\n - VARIANT=src/Test-BoldItalic.ufo\n\nbefore_script: pip install ufolint\n\nscript: \"ufolint $VARIANT\"\n\nnotifications:\n email: false\n```\n\n- **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.\n\nThis 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:\n\n<p align=\"center\">\n <img src =\"https://raw.githubusercontent.com/source-foundry/ufolint/images/images/parallel_ufolint_jobs-crunch.png\" />\n</p>\n\n- **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.\n\n- **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:\n\n```\n[![Build Status](https://travis-ci.org/[ACCOUNT]/[REPOSITORY].svg?branch=master)](https://travis-ci.org/[ACCOUNT]/[REPOSITORY])\n```\n\n## Acknowledgments\n\nBuilt with the fantastic [fontTools ufoLib library](https://github.com/fonttools/fonttools) where a majority of the UFO validation work has been performed!\n\n## License\n\n[MIT License](https://github.com/source-foundry/ufolint/blob/master/docs/LICENSE)\n\n\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "UFO source file linter",
"version": "1.2.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "266131e146130c9f2c7159faf1d4844d",
"sha256": "57344ade8141d3bbbd408225c5e0bf294fc0e1e4b76dc3efe133cd16b8af0adb"
},
"downloads": -1,
"filename": "ufolint-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "266131e146130c9f2c7159faf1d4844d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6.0",
"size": 19140,
"upload_time": "2020-12-08T20:35:21",
"upload_time_iso_8601": "2020-12-08T20:35:21.903830Z",
"url": "https://files.pythonhosted.org/packages/7c/dc/fc8e82404c18d8cf8bb24f9b6f1dfc8d30c10dfa33d3da2631667ddd61c4/ufolint-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "bffca9ac1a3c661681efb65c3b890c7c",
"sha256": "5578c2a17949b33e9a9d2d069849f7a83ca82b5f0a3d35bef8d24668be95bbe7"
},
"downloads": -1,
"filename": "ufolint-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "bffca9ac1a3c661681efb65c3b890c7c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 20001,
"upload_time": "2020-12-08T20:35:23",
"upload_time_iso_8601": "2020-12-08T20:35:23.066954Z",
"url": "https://files.pythonhosted.org/packages/9e/22/1dd70f9be173482352dc9c3555af04bc5db19874b9568b360060fe492ff8/ufolint-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-12-08 20:35:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "source-foundry",
"github_project": "ufolint",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "appdirs",
"specs": [
[
"==",
"1.4.4"
]
]
},
{
"name": "commandlines",
"specs": [
[
"==",
"0.4.1"
]
]
},
{
"name": "fonttools",
"specs": [
[
"==",
"4.27.1"
]
]
},
{
"name": "fs",
"specs": [
[
"==",
"2.4.14"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2021.3"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
}
],
"tox": true,
"lcname": "ufolint"
}