Giter VIP home page Giter VIP logo

codistancing's Introduction

Codistancing is a Python 3.8+ code formatter that makes sure tokens in your code do not infect each other. By using it, you agree to cede control over the looks of your code. In return, Codistancing gives you determinism and extremely unreadable code - but at least it is disease free.

Installation and Usage

Installation

Just clone this project.

Usage

usage: codistancing.py [-h] [-l] [-m MEAN] [-s STD] [-c CODE] [-d]
                       [FILE [FILE ...]]

The annoying (yet disease-free) code formatter.

positional arguments:
  FILE                  Files to reformat (in place) (default: [])

optional arguments:
  -h, --help            show this help message and exit
  -l, --line            Include distancing between lines (default: False)
  -m MEAN, --mean MEAN  Mean number of spaces to add. (default: 4)
  -s STD, --std STD     Standard deviation of number of spaces to add.
                        (default: 0)
  -c CODE, --code CODE  Format the code passed in as a string. (default: None)
  -d, --dry-run         Don't write the files back, just return the status.
                        Return code 0 means nothing would change. Return code
                        1 means some files would be reformatted. (default:
                        False)

Codistancing is a well-behaved Unix-style command-line tool:

  • it does nothing if no sources are passed to it;
  • it only outputs messages to users on standard error;
  • exits with code 0 unless an internal error occurred (or --dry-run was used);
  • its README file is based on cutting edge formatters.

Note: This is a stupid product

Codistancing is not used by anyone and no one should probably use it. Also, this is a beta product and your code might not run after running

The Codistancing code style

Basically, add spaces everywhere. This usually do not go well with PEP8.

Spaces

Codistancing adds four spaces between every two tokens in the same line.

# in:
if (x > y): continue

# out:
if    (    x    >    y    )    :    continue

Line length

If this results in lines longer than 80 characters - well, too bad for you.

# in:
one, two, three, four = (1, 2, 3, 4)

# out:
one    ,    two    ,    three    ,    four    =    (    1    ,    2    ,    3    ,    4    )

Empty lines

If the --line argument is not passed, spacing between lines remains as it is. Otherwise, Codistancing makes sure there are blank lines between every two content lines.

# in:
if x:
    pass

# out:
if    x    :


    pass

The original number of blank lines is ignored.

Tabs vs. spaces

Codistancing does not care whether you use tabs or spaces. Using tabs is your own damn problem and Codistancing cannot help you with that.

Integrations

There are no integrations and I do not plan to add any. This is a stupid tool that was created as a joke during CoVID-19 social distancing times. Do yourself a favor and do not use it if you care about your codebase. Use black instead.

codistancing's People

Contributors

erezvolk avatar ishefi avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

erezvolk

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.