Skip to content

fosskers/ocp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

ocp - Obsessive Compulsive Python
---------------------------------

Does code not lined up all pretty-like bother you?
Does your Haskell experience make you want to line up all your
assignment operators? Is so, then ocp is for you.
ocp will line up all your code when possible with the goal
of making your code as visually pleasing as it deserves to be.

INSTALLING OCP
--------------
Add the following to your .bashrc file:
  alias ocp='python3 /path/to/ocp/ocp.py'

RUNNING OCP
-----------
After installing ocp and restarting your terminal, running:
  ocp some-source.py

will beautify your code, and save it in a copy file labeled like:
  ocp-some-source.py 

Make sure to review the prettified code before you accept it as your
master copy!

ALIGNING BY USER-INDICATED SYMBOLS
----------------------------------
The default symbols by which ocp aligns are:
  import as = #
which are all prime offenders in misaligned code.
By adding extra commandline args, like so:
  ocp some-source.py = == +=
the default symbols will be overwritten and the code will be aligned
by the ones indicated only.
For symbols that would otherwise have meaning in a bash shell,
please put the symbols in quotes, as follows:
  ocp some-haskell-source.hs "<-" "|"

About

Lines up code nicely for people with OCD.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages