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

pylint and coala checks #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
78 changes: 78 additions & 0 deletions .coafile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[Default]
files = **.(py|md|rst|yml), tox.ini, .coafile
ignore = (.tox|env|.env|venv)/**, docs/conf.py

indent_size = 4
use_spaces = True
max_line_length = 120
max_lines_per_file = 1000
file_naming_convention = snake

space_between_ending_comma_and_closing_bracket = yes
dedent_closing_brackets = yes
coalesce_brackets = yes
blank_line_before_nested_class_or_def = yes

[filenames]
bears = FilenameBear

[long-files]
bears = LineCountBear

[spacing]
ignore = (.tox|env|.env|venv)/**, **.yml, tox.ini, .coafile
bears = SpaceConsistencyBear

[config-spacing]
files = **.yml, tox.ini, .coafile
bears = SpaceConsistencyBear
indent_size = 2

[python-spacing] # Own section needed, otherwise conflicts occur
files = **.py
bears = YapfBear

[python-docs]
files = **.py
bears = PyDocStyleBear
pydocstyle_ignore =
D100, D101, D102, D103, D104, D105, # Missing docstrings
D203, # 1 blank line required before class docstring
D213, # Multi-line docstring summary should start at the second line

[python-semantic]
files = **.py
bears = RadonBear, PyUnusedCodeBear
language = python

[yaml]
files = **.(yml|yaml)
bears = YAMLLintBear
yamllint_config = .yamllint

[markdown]
files = **.md
bears = MarkdownBear

[long-lines] # After YapfBear as it might be able to autofix some of those occurrences
bears = LineLengthBear

[commit]
bears = GitCommitBear
shortlog_length = 72
ignore_length_regex = https?://

[keywords]
files = **.py
bears = KeywordBear
language = python
keywords = TODO, FIXME, pdb.set_trace() # Ignore KeywordBear

[links]
bears = InvalidLinkBear
# We ignore:
# - example.com (coala default)
# - {}-style formatting (coala default)
# - %s-style formatting
# - gitlab.skypicker.com since it requires auth
link_ignore_regex = ([./]example.com|{|%(?:\(\w+?\))?s|gitlab\.skypicker\.com)
33 changes: 33 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[MASTER]
# jobs=0 means 'use all CPUs'
jobs=0

[MESSAGES CONTROL]
disable =
missing-docstring,
line-too-long,
invalid-name,
no-value-for-parameter,
no-member,
unused-argument,
broad-except,
relative-import,
wrong-import-position,
bare-except,
locally-disabled,
protected-access,
abstract-method,
no-self-use,
fixme,
too-few-public-methods,
super-init-not-called,
too-many-ancestors,
redefined-outer-name,

[REPORTS]
output-format=colorized

[FORMAT]
logging-modules=
logging,
structlog,
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ language: python
python:
- "2.7"
env:
- DJANGO=1.10
- DJANGO=1.11
install:
- pip install -r requirement/requirement.txt
- pip install pylint
before_script:
- git ls-files | grep .sh$ | xargs -l1 bash -n
- git ls-files | grep .py$ | xargs python -m py_compile
Expand All @@ -13,4 +14,5 @@ before_script:
- python manage.py collectstatic --noinput
- python manage.py migrate --noinput
script:
- pylint . apps tttt
- python manage.py test apps.core.tests.SimpleTest
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Easy way to run Green Tea is using docker https://registry.hub.docker.com/u/paji

```
docker pull pajinek/greentea
docker run -i -t -p 80:8000 pajinek/greentea
docker run -i -t -p 80:8000 pajinek/greentea
```

If you test project with gained systems from Beaker, then you must fill Beaker's authentication values.
Expand All @@ -23,7 +23,7 @@ docker run -i -t -p 80:8000 \
-e BEAKER_SERVER=<beaker_server> \
-e BEAKER_USER=<beaker_user> \
-e BEAKER_PASS=<beaker_pass> \
pajinek/greentea
pajinek/greentea
```

or
Expand All @@ -36,8 +36,8 @@ sudo docker run -i -t -p 80:8000 \
-e BEAKER_SERVER=<beaker_server> \
-e BEAKER_USER=<beaker_user> \
-e BEAKER_PASS=<beaker_pass> \
greentea
```
greentea
```

Service runs on default port 80 (link on your system is http://localhost/)

Expand Down Expand Up @@ -69,3 +69,9 @@ Easer way is deploy project by docker by following script:
```
ansible-playbook -i config/hosts.ini docker.yaml
```

## Code analysis

```
docker run -v=$(pwd):/app -v=/tmp/coala:/cache --workdir=/app coala/base coala --ci
```