Pierre-Sassoulas / remove-empty-comment

Little pre-commit script that remove empty comments from your code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

remove-empty-comment

Little pre-commit script that remove empty comments from your code

PyPI version PRs Welcome

If you feel the need for separators in your code, you might as well start using functions.

Installation

-   repo: https://github.com/Pierre-Sassoulas/remove-empty-comment/
    rev: 1.1.0
    hooks:
    - id: remove-empty-comment
      args: [--meaningless-characters, "-= "]

Use

usage: remove-empty-comment [-h] [-c MEANINGLESS_CHARACTERS] [FILES [FILES ...]]

positional arguments:
  FILES                 File names to modify

optional arguments:
  -h, --help            show this help message and exit
  -c MEANINGLESS_CHARACTERS, --meaningless-characters MEANINGLESS_CHARACTERS
                        Characters that have no meaning alone. If there are alone in a comment, it will be removed.

Before

import argparse

###############
# main function
###############
def main():
    """Main function, can you read?

    parameters:
    -----------
    None"""
    a = 1
    b = 2
    c = a + b

    #

    print(c)


# ARGUMENTS
# =========
parser = argparse.ArgumentParser()

# Checking-inputs
# ------------------------------------
print(parser)

After

import argparse

# main function
def main():
    """Main function, can you read?

    parameters:
    -----------
    None"""
    a = 1
    b = 2
    c = a + b


    print(c)


# ARGUMENTS
parser = argparse.ArgumentParser()

# Checking-inputs
print(parser)

About

Little pre-commit script that remove empty comments from your code

License:MIT License


Languages

Language:Python 100.0%