flake8-ascii-validator


Nameflake8-ascii-validator JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryA Flake8 plugin to validate ASCII characters in Python source code
upload_time2025-08-03 03:08:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords flake8 plugin ascii validation code-quality linting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # flake8-ascii-validator

[![Test Status](https://github.com/shivkumar0757/flake8-ascii-validator/workflows/Test/badge.svg)](https://github.com/shivkumar0757/flake8-ascii-validator/actions)
[![PyPI version](https://badge.fury.io/py/flake8-ascii-validator.svg)](https://badge.fury.io/py/flake8-ascii-validator)
[![Python Support](https://img.shields.io/pypi/pyversions/flake8-ascii-validator.svg)](https://pypi.org/project/flake8-ascii-validator/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Flake8 plugin to validate ASCII characters in Python source code.

## Installation

```bash
pip install flake8-ascii-validator
```

## Usage

```bash
flake8 your_file.py
```

Example output:
```bash
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:
```bash
flake8 --extend-ignore=ASC002
```

Or in your configuration file:
```ini
[flake8]
extend-ignore = ASC002
```

## Examples

Valid ASCII code:
```python
def hello_world():
    message = "Hello, World!"
    return message
```

Invalid non-ASCII code:
```python
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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "flake8-ascii-validator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Shiv Kumar <shivkumar0757@gmail.com>",
    "keywords": "flake8, plugin, ascii, validation, code-quality, linting",
    "author": null,
    "author_email": "Shiv Kumar <shivkumar0757@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1c/c3/a0e9803ee2bfe56e193621facb96c7eee028a98e00a67568d959492f257c/flake8_ascii_validator-1.0.2.tar.gz",
    "platform": null,
    "description": "# flake8-ascii-validator\n\n[![Test Status](https://github.com/shivkumar0757/flake8-ascii-validator/workflows/Test/badge.svg)](https://github.com/shivkumar0757/flake8-ascii-validator/actions)\n[![PyPI version](https://badge.fury.io/py/flake8-ascii-validator.svg)](https://badge.fury.io/py/flake8-ascii-validator)\n[![Python Support](https://img.shields.io/pypi/pyversions/flake8-ascii-validator.svg)](https://pypi.org/project/flake8-ascii-validator/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nFlake8 plugin to validate ASCII characters in Python source code.\n\n## Installation\n\n```bash\npip install flake8-ascii-validator\n```\n\n## Usage\n\n```bash\nflake8 your_file.py\n```\n\nExample output:\n```bash\nexample.py:3:5: ASC001 Non-ASCII character '\u00e9' (U+00E9) found in source code\nexample.py:4:15: ASC002 Non-ASCII character '\u00f8' (U+00F8) found in string literal\nexample.py:5:10: ASC003 Non-ASCII character '\u00f1' (U+00F1) found in comment\n```\n\n## Error Codes\n\n| Code   | Description |\n|--------|-------------|\n| ASC001 | Non-ASCII character found in source code (variable names, function names, etc.) |\n| ASC002 | Non-ASCII character found in string literal |\n| ASC003 | Non-ASCII character found in comment |\n\n## Configuration\n\nIgnore specific error codes:\n```bash\nflake8 --extend-ignore=ASC002\n```\n\nOr in your configuration file:\n```ini\n[flake8]\nextend-ignore = ASC002\n```\n\n## Examples\n\nValid ASCII code:\n```python\ndef hello_world():\n    message = \"Hello, World!\"\n    return message\n```\n\nInvalid non-ASCII code:\n```python\ndef funci\u00f3n():  # ASC001: '\u00f3' in function name\n    vari\u00e1vel = \"caf\u00e9\"  # ASC001: '\u00e1' in variable, ASC002: '\u00e9' in string\n    # Comment\u00e1rio  # ASC003: '\u00e1' in comment\n    return vari\u00e1vel\n```\n\n## Why Use This Plugin?\n\n- **Team Consistency**: Ensure code works across different environments\n- **Legacy Compatibility**: Support systems that don't handle Unicode well\n- **Debugging**: ASCII characters are easier to search and debug\n- **Code Standards**: Enforce ASCII-only policies in your codebase\n\n## Requirements\n\n- Python 3.7+\n- Flake8 3.0.0+\n\n## License\n\nMIT License\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Flake8 plugin to validate ASCII characters in Python source code",
    "version": "1.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/shivkumar0757/flake8-ascii-validator/issues",
        "Documentation": "https://github.com/shivkumar0757/flake8-ascii-validator#readme",
        "Homepage": "https://github.com/shivkumar0757/flake8-ascii-validator",
        "Repository": "https://github.com/shivkumar0757/flake8-ascii-validator"
    },
    "split_keywords": [
        "flake8",
        " plugin",
        " ascii",
        " validation",
        " code-quality",
        " linting"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "86ef45a8924048ef69d527da1af4e93e523fdc5771925d99a712519267bb24e3",
                "md5": "fcfa48f5ad01c3b4d609c2b7864f4d14",
                "sha256": "ad29b1ab1cfa9b102b2f89cb9dc8765dd9dc0b37254281780da4fdf44b07f8bb"
            },
            "downloads": -1,
            "filename": "flake8_ascii_validator-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fcfa48f5ad01c3b4d609c2b7864f4d14",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5358,
            "upload_time": "2025-08-03T03:08:05",
            "upload_time_iso_8601": "2025-08-03T03:08:05.540689Z",
            "url": "https://files.pythonhosted.org/packages/86/ef/45a8924048ef69d527da1af4e93e523fdc5771925d99a712519267bb24e3/flake8_ascii_validator-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1cc3a0e9803ee2bfe56e193621facb96c7eee028a98e00a67568d959492f257c",
                "md5": "364bf60f6e36eb2f358f1392d8ab6c78",
                "sha256": "5e045325ff572b5bc6246fd8e7d388e0ed1cd54396001f5d2348627123baea79"
            },
            "downloads": -1,
            "filename": "flake8_ascii_validator-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "364bf60f6e36eb2f358f1392d8ab6c78",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7445,
            "upload_time": "2025-08-03T03:08:06",
            "upload_time_iso_8601": "2025-08-03T03:08:06.640726Z",
            "url": "https://files.pythonhosted.org/packages/1c/c3/a0e9803ee2bfe56e193621facb96c7eee028a98e00a67568d959492f257c/flake8_ascii_validator-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 03:08:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shivkumar0757",
    "github_project": "flake8-ascii-validator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "flake8-ascii-validator"
}
        
Elapsed time: 2.90295s