Skip to content

Commit 379842b

Browse files
authored
enabled and fixed deprecated-module pylint warnings (danmar#7399)
1 parent 6b68c27 commit 379842b

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

.pylintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ disable=
1717
unused-wildcard-import,
1818
wildcard-import,
1919
unused-argument,
20-
deprecated-module,
2120
pointless-string-statement,
2221
arguments-renamed,
2322
duplicate-string-formatting-argument,

htmlreport/cppcheck-htmlreport

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from __future__ import unicode_literals
44

55
from datetime import date
6+
import argparse
67
import io
78
import locale
89
import operator
9-
import optparse
1010
import os
1111
import re
1212
import sys
@@ -626,38 +626,38 @@ class CppCheckHandler(XmlContentHandler):
626626

627627
def main() -> None:
628628
# Configure all the options this little utility is using.
629-
parser = optparse.OptionParser()
630-
parser.add_option('--title', dest='title',
631-
help='The title of the project.',
632-
default='[project name]')
633-
parser.add_option('--file', dest='file', action="append",
634-
help='The cppcheck xml output file to read defects '
635-
'from. You can combine results from several '
636-
'xml reports i.e. "--file file1.xml --file file2.xml ..". '
637-
'Default is reading from stdin.')
638-
parser.add_option('--checkers-report-file', dest='checkers_report',
629+
parser = argparse.ArgumentParser()
630+
parser.add_argument('--title', dest='title',
631+
help='The title of the project.',
632+
default='[project name]')
633+
parser.add_argument('--file', dest='file', action="append",
634+
help='The cppcheck xml output file to read defects '
635+
'from. You can combine results from several '
636+
'xml reports i.e. "--file file1.xml --file file2.xml ..". '
637+
'Default is reading from stdin.')
638+
parser.add_argument('--checkers-report-file', dest='checkers_report',
639639
help='The cppcheck checkers report file as produced '
640640
'with the "--checkers-report" option of cppcheck.')
641-
parser.add_option('--report-dir', dest='report_dir',
642-
help='The directory where the HTML report content is '
643-
'written.')
644-
parser.add_option('--source-dir', dest='source_dir',
645-
help='Base directory where source code files can be '
646-
'found.')
647-
parser.add_option('--add-author-information', dest='add_author_information',
648-
help='Blame information to include. '
649-
'Adds specified author information. '
650-
'Specify as comma-separated list of either "name", "email", "date" or "n","e","d". '
651-
'Default: "n,e,d"')
652-
parser.add_option('--source-encoding', dest='source_encoding',
641+
parser.add_argument('--report-dir', dest='report_dir',
642+
help='The directory where the HTML report content is '
643+
'written.')
644+
parser.add_argument('--source-dir', dest='source_dir',
645+
help='Base directory where source code files can be '
646+
'found.')
647+
parser.add_argument('--add-author-information', dest='add_author_information',
648+
help='Blame information to include. '
649+
'Adds specified author information. '
650+
'Specify as comma-separated list of either "name", "email", "date" or "n","e","d". '
651+
'Default: "n,e,d"')
652+
parser.add_argument('--source-encoding', dest='source_encoding',
653653
help='Encoding of source code.', default='utf-8')
654-
parser.add_option('--blame-options', dest='blame_options',
655-
help='[-w, -M] blame options which you can use to get author and author mail '
656-
'-w --> not including white spaces and returns original author of the line '
657-
'-M --> not including moving of lines and returns original author of the line')
654+
parser.add_argument('--blame-options', dest='blame_options',
655+
help='[-w, -M] blame options which you can use to get author and author mail '
656+
'-w --> not including white spaces and returns original author of the line '
657+
'-M --> not including moving of lines and returns original author of the line')
658658

659659
# Parse options and make sure that we have an output directory set.
660-
options, _ = parser.parse_args()
660+
options = parser.parse_args()
661661

662662
try:
663663
sys.argv[1]

0 commit comments

Comments
 (0)