Giter Club home page Giter Club logo

ski-lint's Introduction

Enforce ASCII

pre-commit

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 ski-lint, you can install it with pip, pipx, etc.

pip install ski-lint

Usage

$ ski-lint --help
usage: ski-lint [-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

$ ski-lint 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/svdimchenko/ski-lint
  rev: v0.1.0
  hooks:
      - id: ski-lint

ski-lint's People

Contributors

svdimchenko avatar

Watchers

 avatar

Forkers

martenbe

ski-lint's Issues

Show more info on output

Hi, I am using this to find tricky non-ASCII characters when copying from powerpoint into markdown. When doing this, I noticed that a lot of the non-ASCII codes are non-printable. This tool detects and finds them, but makes it hard to find out where the non-ASCII chars are, as they are not word-related. I was wondering if the output could be changed so it shows the file name, line number and character number?

The output of ski-lint:

Screenshot_20240827_161554

More comfortable output by using bash commands:

Screenshot_20240827_161607

More comfortable output using self made python script before I found this repo:

Screenshot_20240827_161316

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.