Coder Social home page Coder Social logo

symmetrical-happiness's Introduction

Symmetrical-Happiness LaTeX Linter

A LaTeX linter written in python

Requirements

  • No special requirements needed if you have a 64-bit Linux or Windows.
  • You can run the source code yourself with python3

Features

  • Lint all files in directories and subdirectories
  • Configurable linter rules
  • Overwrite or create new files
  • It can fix indentation
  • Sentence linting for better git support
  • Comment linting
  • Blank lines before sections

Installation

  1. Download the binary for your system.*
  2. Put the binary file somewhere. Preferably in your project folder.
  3. Run the program from your command-line.

* If there is not a binary for your system you can compile it yourself. Clone the reposotory. Use pyinstaller to compile the file shlint.py. For pyinstaller to work correctly you need to remove the file linter/__init__.py

Link to pyinstaller

pyinstaller linter/shlint.py -F --distpath bin/linux_x64

Usage

shlint [options...] [arguments..]

Options:
    -h, --help      -> displays helpful information on how to use this program
    -o, --overwrite -> formats your original files
    -r, --reset     -> resets the config file, not reversable
Arguments:
    <filename>      -> lints the file
    <directory>/    -> lints all .tex files in directory and sub-directory

Configuration

Symmetrical-Happiness load a configuration file from your current location in your command line. If there is none, a default one will be generated for you.

With the configuration file you can change how the rules are applied. For example how many spaces you want to indent blocks with, and which blocks should be excluded.

Built using

pyinstaller

Used to compile the code into a single binary.

python3

pyyaml - Parses the yaml config file.
glob - Used to recursively find .tex files in directories and sub-directories.
re - Regex for matching and replacing text.
sys - Used to get arguments passed from user.
os - Used to create directories.
unittest - Used to test functionality of linter rules.

Tests

Every linter rule is unit tested. To run the test, run the file test.py All tests are located in the tests folder

python3 test.py

symmetrical-happiness's People

Contributors

jolpango avatar

Watchers

 avatar

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.