Skip to content

Packaging updates #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
.eggs
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See http://editorconfig.org for format details and
# http://editorconfig.org/#download for editor / IDE integration

root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Run this exposing the directory of your choice as the /code volume:
# docker run -i --rm --volume "$(pwd)":/code flake8-codeclimate > codeclimate.json

FROM pypi/flake8
MAINTAINER cadams@loc.gov
FROM python:slim
LABEL maintainer="cadams@loc.gov"

RUN pip install --upgrade pip
RUN pip install flake8-codeclimate
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
GIT_VERSION := $(shell python setup.py --version)

all: docker

docker:
docker build -t flake8-codeclimate:latest .
@if [[ "${GIT_VERSION}" != *"+"* ]]; then \
docker tag flake8-codeclimate:latest flake8-codeclimate:${GIT_VERSION}; \
fi
15 changes: 11 additions & 4 deletions flake8_codeclimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@

"""

import json

from flake8.formatting import base
from pkg_resources import DistributionNotFound, get_distribution

__author__ = 'Ben Lopatin'
__version__ = '0.1.0'
__license__ = 'MIT'


import json
from flake8.formatting import base
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass


category_complexity = "Complexity"
Expand Down Expand Up @@ -72,6 +78,7 @@ def error_category(error):

class JSONFormatter(base.BaseFormatter):
"""Formatter for Code Climate JSON reporting"""

def format(self, error):
return json.dumps({
"type": "issue",
Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[bdist_wheel]
universal = 1

[pycodestyle]
max-line-length=110

[isort]
default_section=THIRDPARTY
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import with_statement

import setuptools

requires = [
Expand All @@ -10,13 +11,16 @@
setuptools.setup(
name="flake8_codeclimate",
license="MIT",
version="0.1.3",
use_scm_version=True,
description="Code Climate reporting formatter plugin for Flake8",
long_description=readme,
author="Ben Lopatin",
author_email="ben@benlopatin.com",
url="https://github.com/bennylope/flake8-codeclimate",
py_modules=['flake8_codeclimate'],
setup_requires=[
'setuptools_scm',
],
install_requires=requires,
entry_points={
'flake8.report': [
Expand Down