A Flake8 plugin to validate ASCII characters in Python source code
Project description
flake8-ascii-validator
Flake8 plugin to validate ASCII characters in Python source code.
Installation
pip install flake8-ascii-validator
Usage
flake8 your_file.py
Example output:
example.py:3:5: ASC001 Non-ASCII character 'é' (U+00E9) found in source code
example.py:4:15: ASC002 Non-ASCII character 'ø' (U+00F8) found in string literal
example.py:5:10: ASC003 Non-ASCII character 'ñ' (U+00F1) found in comment
Error Codes
| Code | Description |
|---|---|
| ASC001 | Non-ASCII character found in source code (variable names, function names, etc.) |
| ASC002 | Non-ASCII character found in string literal |
| ASC003 | Non-ASCII character found in comment |
Configuration
Ignore specific error codes:
flake8 --extend-ignore=ASC002
Or in your configuration file:
[flake8]
extend-ignore = ASC002
Examples
Valid ASCII code:
def hello_world():
message = "Hello, World!"
return message
Invalid non-ASCII code:
def función(): # ASC001: 'ó' in function name
variável = "café" # ASC001: 'á' in variable, ASC002: 'é' in string
# Commentário # ASC003: 'á' in comment
return variável
Why Use This Plugin?
- Team Consistency: Ensure code works across different environments
- Legacy Compatibility: Support systems that don't handle Unicode well
- Debugging: ASCII characters are easier to search and debug
- Code Standards: Enforce ASCII-only policies in your codebase
Requirements
- Python 3.7+
- Flake8 3.0.0+
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_ascii_validator-1.0.2.tar.gz.
File metadata
- Download URL: flake8_ascii_validator-1.0.2.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e045325ff572b5bc6246fd8e7d388e0ed1cd54396001f5d2348627123baea79
|
|
| MD5 |
364bf60f6e36eb2f358f1392d8ab6c78
|
|
| BLAKE2b-256 |
1cc3a0e9803ee2bfe56e193621facb96c7eee028a98e00a67568d959492f257c
|
Provenance
The following attestation bundles were made for flake8_ascii_validator-1.0.2.tar.gz:
Publisher:
publish.yml on shivkumar0757/flake8-ascii-validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flake8_ascii_validator-1.0.2.tar.gz -
Subject digest:
5e045325ff572b5bc6246fd8e7d388e0ed1cd54396001f5d2348627123baea79 - Sigstore transparency entry: 345463646
- Sigstore integration time:
-
Permalink:
shivkumar0757/flake8-ascii-validator@c0ae209c05af5b624c0e8a7bdca1d5aebbb84e9c -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/shivkumar0757
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c0ae209c05af5b624c0e8a7bdca1d5aebbb84e9c -
Trigger Event:
release
-
Statement type:
File details
Details for the file flake8_ascii_validator-1.0.2-py3-none-any.whl.
File metadata
- Download URL: flake8_ascii_validator-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad29b1ab1cfa9b102b2f89cb9dc8765dd9dc0b37254281780da4fdf44b07f8bb
|
|
| MD5 |
fcfa48f5ad01c3b4d609c2b7864f4d14
|
|
| BLAKE2b-256 |
86ef45a8924048ef69d527da1af4e93e523fdc5771925d99a712519267bb24e3
|
Provenance
The following attestation bundles were made for flake8_ascii_validator-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on shivkumar0757/flake8-ascii-validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flake8_ascii_validator-1.0.2-py3-none-any.whl -
Subject digest:
ad29b1ab1cfa9b102b2f89cb9dc8765dd9dc0b37254281780da4fdf44b07f8bb - Sigstore transparency entry: 345463661
- Sigstore integration time:
-
Permalink:
shivkumar0757/flake8-ascii-validator@c0ae209c05af5b624c0e8a7bdca1d5aebbb84e9c -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/shivkumar0757
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c0ae209c05af5b624c0e8a7bdca1d5aebbb84e9c -
Trigger Event:
release
-
Statement type: