File tree Expand file tree Collapse file tree 7 files changed +51
-7
lines changed Expand file tree Collapse file tree 7 files changed +51
-7
lines changed Original file line number Diff line number Diff line change
1
+ .git
2
+ .eggs
Original file line number Diff line number Diff line change
1
+ # See http://editorconfig.org for format details and
2
+ # http://editorconfig.org/#download for editor / IDE integration
3
+
4
+ root = true
5
+
6
+ [* ]
7
+ indent_style = space
8
+ indent_size = 4
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
11
+ end_of_line = lf
12
+ charset = utf-8
13
+
14
+ # Makefiles always use tabs for indentation
15
+ [Makefile ]
16
+ indent_style = tab
Original file line number Diff line number Diff line change 1
1
# Run this exposing the directory of your choice as the /code volume:
2
2
# docker run -i --rm --volume "$(pwd)":/code flake8-codeclimate > codeclimate.json
3
3
4
- FROM pypi/flake8
5
- MAINTAINER cadams@loc.gov
4
+ FROM python:slim
5
+ LABEL maintainer= " cadams@loc.gov"
6
6
7
7
RUN pip install --upgrade pip
8
8
RUN pip install flake8-codeclimate
Original file line number Diff line number Diff line change
1
+ GIT_VERSION := $(shell python setup.py --version)
2
+
3
+ all : docker
4
+
5
+ docker :
6
+ docker build -t flake8-codeclimate:latest .
7
+ @if [[ " ${GIT_VERSION} " != * " +" * ]]; then \
8
+ docker tag flake8-codeclimate:latest flake8-codeclimate:${GIT_VERSION} ; \
9
+ fi
Original file line number Diff line number Diff line change 7
7
8
8
"""
9
9
10
+ import json
11
+
12
+ from flake8 .formatting import base
13
+ from pkg_resources import DistributionNotFound , get_distribution
14
+
10
15
__author__ = 'Ben Lopatin'
11
- __version__ = '0.1.0'
12
16
__license__ = 'MIT'
13
17
14
-
15
- import json
16
- from flake8 .formatting import base
18
+ try :
19
+ __version__ = get_distribution (__name__ ).version
20
+ except DistributionNotFound :
21
+ # package is not installed
22
+ pass
17
23
18
24
19
25
category_complexity = "Complexity"
@@ -72,6 +78,7 @@ def error_category(error):
72
78
73
79
class JSONFormatter (base .BaseFormatter ):
74
80
"""Formatter for Code Climate JSON reporting"""
81
+
75
82
def format (self , error ):
76
83
return json .dumps ({
77
84
"type" : "issue" ,
Original file line number Diff line number Diff line change 1
1
[bdist_wheel]
2
2
universal = 1
3
+
4
+ [pycodestyle]
5
+ max-line-length =110
6
+
7
+ [isort]
8
+ default_section =THIRDPARTY
Original file line number Diff line number Diff line change 1
1
from __future__ import with_statement
2
+
2
3
import setuptools
3
4
4
5
requires = [
10
11
setuptools .setup (
11
12
name = "flake8_codeclimate" ,
12
13
license = "MIT" ,
13
- version = "0.1.3" ,
14
+ use_scm_version = True ,
14
15
description = "Code Climate reporting formatter plugin for Flake8" ,
15
16
long_description = readme ,
16
17
author = "Ben Lopatin" ,
17
18
author_email = "ben@benlopatin.com" ,
18
19
url = "https://github.com/bennylope/flake8-codeclimate" ,
19
20
py_modules = ['flake8_codeclimate' ],
21
+ setup_requires = [
22
+ 'setuptools_scm' ,
23
+ ],
20
24
install_requires = requires ,
21
25
entry_points = {
22
26
'flake8.report' : [
You can’t perform that action at this time.
0 commit comments