Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
Drop Python 2.7 and release 2.0.0 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthagen authored Mar 29, 2020
1 parent 408b955 commit 2998a6a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 25 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ language: python
dist: xenial
matrix:
include:
- python: 2.7
- python: 3.5
- python: 3.6
- python: 3.7
- python: 3.8
- python: pypy
- python: pypy3

install:
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ Convert it to JUnit XML format:
Releases
--------

2.0.0 - 2020-03-29
^^^^^^^^^^^^^^^^^^

- Drop Python 2.7

1.3.0 - 2019-12-15
^^^^^^^^^^^^^^^^^^

Expand Down
21 changes: 6 additions & 15 deletions cpplint_junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@
import os
import re
import sys
from typing import Dict, List # noqa
from typing import Dict, List
from xml.etree import ElementTree

from exitstatus import ExitStatus


class CpplintError(object):
def __init__(self,
file, # type: str
line, # type: int
message # type: str
):
# type: () -> CpplintError
def __init__(self, file: str, line: int, message: str) -> None:
"""Constructor.
Args:
Expand All @@ -32,16 +27,14 @@ def __init__(self,
self.message = message


def parse_arguments():
# type: () -> argparse.Namespace
def parse_arguments() -> argparse.Namespace:
parser = argparse.ArgumentParser(description='Converts cpplint output to JUnit XML format.')
parser.add_argument('input_file', type=str, help='cpplint stdout text file.')
parser.add_argument('output_file', type=str, help='JUnit XML output file.')
return parser.parse_args()


def parse_cpplint(file_name):
# type: (str) -> Dict[str, List[CpplintError]]
def parse_cpplint(file_name: str) -> Dict[str, List[CpplintError]]:
"""Parses a cpplint output file.
Args:
Expand Down Expand Up @@ -69,8 +62,7 @@ def parse_cpplint(file_name):
return errors


def generate_test_suite(errors):
# type: (Dict[str, List[CpplintError]]) -> ElementTree.ElementTree
def generate_test_suite(errors: Dict[str, List[CpplintError]]) -> ElementTree.ElementTree:
"""Creates a JUnit XML tree from parsed cpplint errors.
Args:
Expand Down Expand Up @@ -100,8 +92,7 @@ def generate_test_suite(errors):
return ElementTree.ElementTree(test_suite)


def main(): # pragma: no cover
# type: () -> ExitStatus
def main() -> ExitStatus: # pragma: no cover
"""Main function.
Returns:
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
exitstatus
typing
exitstatus
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='cpplint-junit',
version='1.3.0',
version='2.0.0',

description='Converts cpplint output to JUnit format.',
long_description=open('README.rst').read(),
Expand All @@ -15,9 +15,11 @@

py_modules=['cpplint_junit'],
install_requires=open('requirements.txt').readlines(),
python_requires='<=3.5',
zip_safe=False,

license='MIT',
license_files=['LICENSE.txt'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
Expand Down

0 comments on commit 2998a6a

Please sign in to comment.