<commit_before>#!/usr/bin/env python

# Copyright (c) 2001, MetaSlash Inc.  All rights reserved.

"""
Configuration information for checker.
"""

import sys
import getopt


_DEFAULT_BLACK_LIST = [ "Tkinter", ]


class Config :
    "Hold configuration information"

    def __init__(self) :
        "Initialize configuration with default values."

        self.debug = 0

        self.noDocModule = 1
        self.noDocClass = 1
        self.noDocFunc = 0

        self.allVariablesUsed = 0
        self.privateVariableUsed = 1
        self.importUsed = 1
        self.localVariablesUsed = 1
        self.unusedLocalTuple = 0
        self.blacklist = _DEFAULT_BLACK_LIST


def printArg(shortArg, longArg, description, defaultValue = None) :
    args = "-%s, --%s" % (shortArg, longArg)
    defStr = ''
    if defaultValue != None :
        if defaultValue :
            defaultValue = 'on'
        else :
            defaultValue = 'off'
        defStr = ' [%s]' % defaultValue
    print "    %-17s %s%s" % (args, description, defStr)


_OPTIONS = [ 
  ('s', 'doc', None, 'turn off all warnings for no doc strings'),
  ('m', 'moduledoc', 'noDocModule', 'no module doc strings'),
  ('c', 'classdoc', 'noDocClass', 'no class doc strings'),
  ('f', 'funcdoc', 'noDocFunc', 'no function/method doc strings'),
  None,
  ('i', 'import', 'importUsed', 'unused imports'),
  ('l', 'local', 'localVariablesUsed', 'unused local variables, except tuples'),
  ('t', 'tuple', 'unusedLocalTuple', 'all unused local variables, including tuples'),
  ('v', 'var', 'allVariablesUsed', 'all unused module variables'),
  ('p', 'privatevar', 'privateVariableUsed', 'unused private module variables'),
  None,
  ('d', 'debug', 'debug', 'turn on debugging for checker'),
  None,
]


def usage() :
    print "Usage for: checker.py [options] PACKAGE ...\n"
    print "    PACKAGEs can be a python package, module or filename\n"
    print "  Options:          Toggle warning for"
    cfg = Config()
    for opt in _OPTIONS :
        if opt == None :
            print ""
            continue

        shortArg, longArg, member, description = opt
        defValue = None
        if member != None :
            defValue = cfg.__dict__[member]

        printArg(shortArg, longArg, description, defValue)
<commit_msg>show that [] is the default value in usage()<commit_after>#!/usr/bin/env python

# Copyright (c) 2001, MetaSlash Inc.  All rights reserved.

"""
Configuration information for checker.
"""

import sys
import getopt


_DEFAULT_BLACK_LIST = [ "Tkinter", ]


class Config :
    "Hold configuration information"

    def __init__(self) :
        "Initialize configuration with default values."

        self.debug = 0

        self.noDocModule = 1
        self.noDocClass = 1
        self.noDocFunc = 0

        self.allVariablesUsed = 0
        self.privateVariableUsed = 1
        self.importUsed = 1
        self.localVariablesUsed = 1
        self.unusedLocalTuple = 0
        self.blacklist = _DEFAULT_BLACK_LIST


def printArg(shortArg, longArg, description, defaultValue = None) :
    args = "-%s, --%s" % (shortArg, longArg)
    defStr = ''
    if defaultValue != None :
        if defaultValue :
            defaultValue = 'on'
        else :
            defaultValue = 'off'
        defStr = ' [%s]' % defaultValue
    print "    %-17s %s%s" % (args, description, defStr)


_OPTIONS = [ 
  ('s', 'doc', None, 'turn off all warnings for no doc strings'),
  ('m', 'moduledoc', 'noDocModule', 'no module doc strings'),
  ('c', 'classdoc', 'noDocClass', 'no class doc strings'),
  ('f', 'funcdoc', 'noDocFunc', 'no function/method doc strings'),
  None,
  ('i', 'import', 'importUsed', 'unused imports'),
  ('l', 'local', 'localVariablesUsed', 'unused local variables, except tuples'),
  ('t', 'tuple', 'unusedLocalTuple', 'all unused local variables, including tuples'),
  ('v', 'var', 'allVariablesUsed', 'all unused module variables'),
  ('p', 'privatevar', 'privateVariableUsed', 'unused private module variables'),
  None,
  ('d', 'debug', 'debug', 'turn on debugging for checker'),
  None,
]


def usage() :
    print "Usage for: checker.py [options] PACKAGE ...\n"
    print "    PACKAGEs can be a python package, module or filename\n"
    print "  Options:          Toggle warning for ... [default value]"
    cfg = Config()
    for opt in _OPTIONS :
        if opt == None :
            print ""
            continue

        shortArg, longArg, member, description = opt
        defValue = None
        if member != None :
            defValue = cfg.__dict__[member]

        printArg(shortArg, longArg, description, defValue)

{'fraction_non_alphanumeric': 0.13216526065325546, 'fraction_numerical': 0.006489292667099286, 'mean_word_length': 2.7260273972602738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '545007', 'n_tokens_mistral': 1435, 'n_tokens_neox': 1377, 'n_words': 437}