Skip to main content

Enforce ASCII

pre-commit

VERSION: 0.2.0

A Python package to find files containing non-ASCII encoded characters. If you find any bugs, issues or anything, please use the issue tracker on GitHub - issues and PRs are welcome ❤️

Install

It's on PyPi as enforce-python, you can install it with pip, pipx, etc.

pip install enforce-ascii

Usage

$ enforce-ascii --help
usage: enforce-ascii [-h] [--version] [--check] FILENAME [FILENAME ...]

A pre-commit hook, that rejects files containing non ASCII characters.

positional arguments:
  FILENAME    path to the files to check

optional arguments:
  -h, --help  show this help message and exit
  --version   show program's version number and exit
  --check     return code is `1`, when non-ASCII files are found

Example

$ enforce-ascii tests/files/*/*.txt
- tests/files/bad/special.txt (Windows-1252): there…
- tests/files/bad/umlaut.txt (utf-8): föur, käle, Åir

Pre-Commit

This can be used as a pre-commit hook:

- repo: https://github.com/brutus/enforce-ascii
  rev: v0.2.0
  hooks:
      - id: enforce-ascii

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enforce-ascii-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

enforce_ascii-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file enforce-ascii-0.2.0.tar.gz.

File metadata

  • Download URL: enforce-ascii-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/5.6.6-200.fc31.x86_64

File hashes

Hashes for enforce-ascii-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5f4cf666fd7e32af8cb0f11591cfe3a1e0b034b82e0390bafba0cef00332fe6c
MD5 5fddb1d8aab9eee5031d16c782bba559
BLAKE2b-256 0346dc2f7681c1da9b91c9cc7eaefd6551aa67910418b873245e1b8566ba6a5e

See more details on using hashes here.

File details

Details for the file enforce_ascii-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: enforce_ascii-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/5.6.6-200.fc31.x86_64

File hashes

Hashes for enforce_ascii-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9eaa6ad8c6dbed5c6b5625c7d547aa12c54783a86dc5918329ba22186babfb7
MD5 88660a4bc2afe8edd7c527b447c396cb
BLAKE2b-256 89f27ee1b3788c790700e831bf9425492901c64994fc3bb68bd1be4cee8e5cb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page