Skip to content

Commit

Permalink
Merge 03c6477 into 8e21ade
Browse files Browse the repository at this point in the history
  • Loading branch information
gforcada committed Sep 18, 2015
2 parents 8e21ade + 03c6477 commit 0582bf0
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 444 deletions.
27 changes: 25 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,33 @@ Change history
2.1 (unreleased)
----------------

- Remove debug statements checker, flake8-debugger, flake8-print and jshint can do the
same job.
- Remove debug statements checker,
`flake8-debugger <https://pypi.python.org/pypi/flake8-debugger>`_,
`flake8-print <https://pypi.python.org/pypi/flake8-print>`_
and jshint can do the same job.
[gforcada]

- Removed pep3101 checker,
`flake8-pep3101 <https://pypi.python.org/pypi/flake8-pep3101>`_
works exactly the same.
[gforcada]

- Remove deprecated aliases checker,
`flake8-deprecated <https://pypi.python.org/pypi/flake8-deprecated>`_
does the same job.
[gforcada]

- Remove hasattr checker,
`flake8-plone-hasattr <https://pypi.python.org/pypi/flake8-plone-hasattr>`_
does the same job.
[gforcada]

- Add a ``[recommended]`` extra to install a set of flake8 plugins,
some of them where part of p.r.codeanalysis up until this release.
[gforcada]

- Remove leftovers from utf-8 checker removal.
[gforcada]

2.0.2 (2015-09-03)
------------------
Expand Down
49 changes: 13 additions & 36 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,28 @@ This configuration looks like this:
tslint = True
tslint-bin = ${buildout:directory}/bin/tslint
tslint-exclude = ${:jscs-exclude}
# Deprecation warnings
deprecated-aliases = True
# Conventions
clean-lines = True
clean-lines-exclude = ${:jscs-exclude}
imports = True
pep3101 = True
prefer-single-quotes = True
# i18n
utf8-header = True
find-untranslated = True
i18ndude-bin = ${buildout:bin-directory}/i18ndude
return-status-codes = True
flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg,*.cpy,*.vpy,overrides
flake8-extensions =
flake8-blind-except
flake8-coding
flake8-debugger
flake8-deprecated
flake8-isort
flake8-pep3101
flake8-plone-api
flake8-plone-hasattr
flake8-print
flake8-quotes
flake8-string-format
flake8-todo
[node]
recipe = gp.recipe.node
Expand Down Expand Up @@ -378,17 +386,6 @@ The recipe supports the following options:
Allows you to specify directories and/or files which you don't want to be
checked. Default is none.

**deprecated-aliases**
For historical reasons, some of the unittest.TestCase methods had one or
more aliases that are deprecated on Python 2.7. If this option is set to
True, warnings about deprecated aliases will be printed. Default is
``False``. See `Unit testing framework documentation`_ for more
information.

**deprecated-aliases-exclude**
Allows you to specify directories and/or files which you don't want to be
checked. Default is none.

**clean-lines**
If set to True, **any file** containing trailing spaces or tabs anywhere
on the lines will cause a warning. Default is ``False``.
Expand All @@ -397,15 +394,6 @@ The recipe supports the following options:
Allows you to specify directories and/or files which you don't want to be
checked. Default is none.

**pep3101**
If set to True, Python files will be scanned in search of existing '%'
string formatting operators. Default is ``False``. See `PEP 3101 (Advanced
String Formatting)`_ for more information.

**pep3101-exclude**
Allows you to specify directories and/or files which you don't want to be
checked. Default is none.

**imports**
If set to True, checks that imports in Python files follow `plone.api
conventions`_. This also includes checking for alphabetically sorted
Expand All @@ -415,16 +403,6 @@ The recipe supports the following options:
Allows you to specify directories and/or files which you don't want to be
checked. Default is none.

**hasattr**
If set to True, scan Python files looking for ``hasattr`` calls.
This is considered bad practice as it swallows exceptions.
Use ``getattr(obj, attribute, None)`` always.
Default is ``False``.

**hasattr-exclude**
Allows you to specify directories and/or files which you don't want to be
checked. Default is none.

**return-status-codes**
If set to True, the ``bin/code-analysis`` script returns an error code
that Continuous Integration servers (like Travis CI) can use to fail or
Expand Down Expand Up @@ -506,4 +484,3 @@ Upgrade JSHint to latest version (>= 2.1.6) to fix this issue, e.g.::
.. _`Unit testing framework documentation`: http://docs.python.org/2/library/unittest.html#deprecated-aliases
.. _`Mockup`: https://github.com/plone/mockup
.. _`jscs website`: https://www.npmjs.org/package/jscs

5 changes: 0 additions & 5 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ pre-commit-hook = True
check-manifest = True
clean-lines = True
csslint = False
debug-statements = False
deprecated-aliases = True
deprecated-aliases-exclude = ${:directory}/tests/test_deprecated_aliases.py
flake8-max-complexity = 12
flake8-extensions =
flake8-blind-except
Expand All @@ -49,9 +46,7 @@ flake8-extensions =
imports = True
jshint = False
jshint-bin = ${buildout:directory}/bin/jshint
pep3101 = False
return-status-codes = False
hasattr = True
# this options only take efect if the dependencies are installed
find-untranslated = True
i18ndude-bin = ${buildout:directory}/bin/i18ndude
Expand Down
16 changes: 0 additions & 16 deletions plone/recipe/codeanalysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
from plone.recipe.codeanalysis.check_manifest import CheckManifest
from plone.recipe.codeanalysis.clean_lines import CleanLines
from plone.recipe.codeanalysis.csslint import CSSLint
from plone.recipe.codeanalysis.deprecated_aliases import DeprecatedAliases
from plone.recipe.codeanalysis.flake8 import Flake8
from plone.recipe.codeanalysis.i18ndude import I18NDude
from plone.recipe.codeanalysis.imports import Imports
from plone.recipe.codeanalysis.jscs import JSCS
from plone.recipe.codeanalysis.jshint import JSHint
from plone.recipe.codeanalysis.pep3101 import PEP3101
from plone.recipe.codeanalysis.py_hasattr import HasAttr
from plone.recipe.codeanalysis.zptlint import ZPTLint
from time import time
import os
Expand All @@ -23,14 +20,11 @@
CSSLint,
CheckManifest,
CleanLines,
DeprecatedAliases,
Flake8,
HasAttr,
I18NDude,
Imports,
JSCS,
JSHint,
PEP3101,
ZPTLint,
]

Expand Down Expand Up @@ -74,24 +68,14 @@ def __init__(self, buildout, name, options):
# check-manifest
self.options.setdefault('check-manifest', 'False')
self.options.setdefault('check-manifest-directory', '.')
# Warn about usage of deprecated aliases
self.options.setdefault('deprecated-aliases', 'False')
# utf-8 header
self.options.setdefault('utf8-header', 'False')
# clean lines
self.options.setdefault('clean-lines', 'False')
self.options.setdefault('clean-lines-exclude', '')
# Prefer single quotes over double quotes
self.options.setdefault('prefer-single-quotes', 'False')
# PEP 3101 (Advanced String Formatting)
self.options.setdefault('pep3101', 'False')
# imports
self.options.setdefault('imports', 'False')
# Jenkins output
self.options.setdefault('jenkins', 'False')
self.options.setdefault('flake8-filesystem', 'False')
# hasattr
self.options.setdefault('hasattr', 'False')
# Error codes
self.options.setdefault('return-status-codes', 'False')
# Find untranslated strings
Expand Down
49 changes: 0 additions & 49 deletions plone/recipe/codeanalysis/deprecated_aliases.py

This file was deleted.

42 changes: 0 additions & 42 deletions plone/recipe/codeanalysis/pep3101.py

This file was deleted.

23 changes: 0 additions & 23 deletions plone/recipe/codeanalysis/py_hasattr.py

This file was deleted.

81 changes: 0 additions & 81 deletions plone/recipe/codeanalysis/tests/test_deprecated_aliases.py

This file was deleted.

0 comments on commit 0582bf0

Please sign in to comment.