Package: plone.recipe.codeanalysis
ContentsIntroductionInstallation[recommended]extraGit hooksConfigurationoverridesJenkins InstallationFilesystem outputLinksSupported optionsi18ndude, scsslint and zptlint supportKnown IssuesExample usagePre-commit hookContributorsChange history3.0.1 (2018-06-27)3.0.0 (2018-06-27)3.0.0a (2018-06-15)2.3 (2018-01-18)2.2 (2016-02-20)2.1 (2015-09-21)2.0.2 (2015-09-03)2.0.1 (2015-09-02)2.0 (2015-08-07)2.0b1 (2015-05-03)2.0a2 (2015-04-30)2.0a1 (2015-04-27)1.1 (2014-12-04)1.0 (2014-12-04)1.0rc1 (2014-06-18)1.0b8 (2014-06-05)1.0b7 (2014-05-04)1.0b6 (2013-10-16)1.0b5 (2013-10-08)1.0b4 (2013-10-06)1.0b3 (2013-09-12)1.0b2 (2013-09-11)1.0b1 (2013-08-12)1.0a1 (2013-08-04)Introductionplone.recipe.codeanalysisprovides static code analysis for Buildout-based
Python projects, includingflake8,JSHint,CSS Lint, and
other code checks.This buildout recipe creates a script to run the code analysis:bin/code-analysisBy defaultplone.recipe.codeanalysisalso creates a git pre-commit hook, in
order to run the code analysis automatically before each commit.plone.recipe.codeanalysiscomes with a Jenkins integration, that allows to
use the same code analysis settings on your local machine as well as on
Jenkins.It also allows to run code analysis to any arbitrary folder:bin/code-analysis src/Products.CMFPloneInstallationJust add a code-analysis section to your buildout.cfg:[buildout]parts +=code-analysis[code-analysis]recipe=plone.recipe.codeanalysisdirectory=${buildout:directory}/srcThe directory option is not required. Though, if you don’t specify a directory
the code analysis will check every file in your buildout directory.This configuration is helpful for working on already existing packages.
If you create a new package you might want to enable all checks.
This configuration looks like this:[code-analysis]recipe=plone.recipe.codeanalysis[recommended]multiprocessing=Truejenkins=Falsedirectory=${buildout:directory}/srcreturn-status-codes=Truepre-commit-hook=True# JSjshint=Truejshint-bin=${buildout:bin-directory}/jshintjshint-suppress-warnings=Falsejscs=Truejscs-bin=${buildout:bin-directory}/jscsjscs-exclude=${buildout:directory}/dev/bower_components${buildout:directory}/node_modules# CSScsslint=Truecsslint-bin=${buildout:bin-directory}/csslint# ZPTzptlint=Truezptlint-bin=${buildout:bin-directory}/zptlint# Chameleon uses XML (there is no chameleon-lint-bin, it uses lxml)chameleon-lint=False# XML (there is no xmllint-bin, it uses lxml)xmllint=True# scss-lintscsslint=Truescsslint-bin=${buildout:bin-directory}/scss-lint# TStslint=Truetslint-bin=${buildout:directory}/bin/tslinttslint-exclude=${:jscs-exclude}# Conventionsclean-lines=Trueclean-lines-exclude=${:jscs-exclude}# dependency-checkerdependencychecker=Truedependencychecker-bin=${buildout:directory}/bin/dependencychecker# i18nfind-untranslated=Truei18ndude-bin=${buildout:bin-directory}/i18ndudeflake8-exclude=bootstrap.py,bootstrap-buildout.py,docs,*.egg,*.cpy,*.vpy,overrides[node]recipe=gp.recipe.nodenpms=csslint jshint jscs tslintscripts=csslint jshint jscs tslint[recommended]extraThis extra enables a host of flake8 plugins.
They are mostly codingPlone’s styleguide(specially the Python section).These are the current extras installed:flake8-blind-except: warns about catching any exception, i.eexcept:flake8-coding: warns about python files with missing coding headerflake8-debugger: warns about debug statements found in code (like pdb…)flake8-deprecated: warns about deprecated method callsflake8-isort: warns about imports not sorted properly (note that anextra configurationis needed)flake8-pep3101: warns about old-style formatting, i.e'format a %s' % stringflake8-plone-api: warns about code that could be replaced by plone.api calls (note that this is forbidden for Plone core packages)flake8-plone-hasattr: warns about usinghasattras it shallows exceptionsflake8-print: warns aboutprintbeing usedflake8-quotes: warns about using double quotes (plone style guide says single quotes)flake8-string-format: warns about errors on string formattingflake8-todo: warns if there areTODO,XXXfound on the codeflake8-commas: warns if the last element on a method call, list or dictionary does not end with a commaGit hookspre-commit-hookpre-commit-return-status-codespre-push-hookpre-push-return-status-codesYou can choose to activate gitpre-commit-hookand/orpre-push-hookhooks.
You can make these hooks blocking (aborting) by settingreturn-status-codesto ‘True’. You can tune the return code behavior differently from the default
for each hook, usingpre-commit-return-status-codesandpre-push-return-status-codes.What works best for you is a matter of taste, and code base.If you want to ensure that your working area is always clean on each commit,
and you’d like to abort the commit if anything untowards is found, you can
configure:[code-analysis]
return-status-codes = True
pre-commit-hook = TrueIf you’re working in a large code base, which takes a long time to
parse, and your workflow is to use many small commits, you may be
annoyed by the pre-commit delay.  Or maybe you like to check in parts
of your work, while having other files hanging around in your working
tree which aren’t cleaned up yet.In that case you may want to disable pre-commit checks, and have a blocking
pre-push check instead:[code-analysis]
return-status-codes = True
pre-commit-hook = False
pre-push-hook = TrueOr maybe you wantcode-analysisby default to run unblocking, to
please Jenkins, but still want to have blocking checks on both pre-commit
and pre-push? Can do:[code-analysis]
return-status-codes = False
pre-commit-hook = True
pre-commit-return-status-codes = True
pre-push-hook = True
pre-push-return-status-codes = TrueYeah I know, it’s a contrived example, but it illustrates the relevant options.ConfigurationoverridesThe options documented above configure code-analysis at the project level.
Sometimes developers may want to deviate from the project-level settings locally,
for example to make the git pre-commit hook block on violations, even when
the project-wide setting is to not abort the commit on violations.If for example the projectbuildout.cfgreads:[code-analysis]
overrides = code-analysis-overrides-acmecorp
return-status-codes = False
pre-commit-hook = TrueBut as a developer I’d rather have a blocking pre-push instead of a nonblocking
pre-commit, I can configure overrides in my.buildout/default.cfgconfiguration as follows:[code-analysis-overrides-acmecorp]
return-status-codes = True
pre-commit-hook = False
pre-push-hook = TrueThis is especially handy to let users choose themselves whether they want
a pre-commit-hook or a pre-push-hook, and whether they want
to block on violations (so they don’t have to amend commits) or whether they
want non-blocking checks (so they can have invalid files in their
working tree outside the commited c.q. pushed set of files). YMMV.Note that if a project does not configureoverridesat the project
level, you can as a dev still configure that in.buildout/default.cfg:[code-analysis]
overrides = code-analysis-overrides

[code-analysis-overrides]
return-status-codes = TrueThe recommended policy is to define an overrides name per project, so devs
can tune their overrides per project. Repo-specific override names only
make sense if the repo is really different (say much bigger) than typical.
Per-project override names would show up in a devs.buildout/default.cfgfor example as follows:[code-analysis-overrides-plone]
return-status-codes = True
pre-commit-hook = True
pre-push-hook = True

[code-analysis-overrides-grok]
<= code-analysis-overrides-plone

[code-analysis-overrides-acmecorp]
return-status-codes = True
pre-commit-hook = False
pre-push-hook = TrueFor projects that really really want to NOT offer this option to their
developers, there’s the simple solution of blocking overrides in the
projectbuildout.cfg:[code-analysis]
overrides = FalseIt’s recommended to actually talk to your fellow devs about which
overrides are not acceptable, instead of taking this nuclear option.
If a developer disagrees with the set of flake8 extensions you’re validating
with, that’s really a social issue, not something that can be solved in code.A more suble way of controlling what local reconfigurations a dev is
allowed to perform is to configure theoverrides-allowedwhitelist
at the project level:[code-analysis]
overrides-allowed = multiprocessing
                    return-status-codes
                    pre-commit-hook
                    pre-commit-return-status-codes
                    pre-push-hook
                    pre-push-return-status-codesAs a result, only the override options listed here will be taken from
the developer’s local configuration, all other options will be taken
from the project buildout.cfg. Listing an emptyoverrides-allowedoption allows all options to be overridden.But of course, all of this runs on the developer’s machine…Jenkins Installationplone.recipe.codeanalysis provides a Jenkins setting that allows to run it on a Jenkins CI server and to process and integrate the output via theJenkins Violations plugin.Usually you don’t want the recipe to create Jenkins output files on your
local machine. Therefore it makes sense to enable the Jenkins output only
on the CI machine. To do so, just create a jenkins.cfg that extends and
overrides the default buildout file (that includes the other settings):[buildout]parts +=code-analysis[code-analysis]recipe=plone.recipe.codeanalysisjenkins=TrueThe Jenkins job itself should runbin/code-analysis:python bootstrap.py -c jenkins.cfg
bin/buildout -c jenkins.cfg
bin/jenkins-test --all
bin/code-analysisTheJenkins Violations pluginneeds to be configured to read the output
files generated by this configuration.pep8 (to read the flake8 output):**/parts/code-analysis/flake8.logcsslint:**/parts/code-analysis/csslint.xmlcsslint:**/parts/code-analysis/scsslint.xmljslint (to read the jshint output):**/parts/code-analysis/jshint.xmlcheckstyle (to read the jscs output):**/parts/code-analysis/jscs.xmlFilesystem outputIf jenkins is set to False, you can still store the output on the filesystem by settingflake8-filesystem= True.
This is ignored if jenkins is set to True.output:**/parts/code-analysis/flake8.txtLinksCode repository:https://github.com/plone/plone.recipe.codeanalysisContinuous Integration:https://travis-ci.org/plone/plone.recipe.codeanalysisIssue Tracker:https://github.com/plone/plone.recipe.codeanalysis/issuesSupported optionsIf you need to bypass checks for some reasons on a specific line you may use# noqain Python or// noqain Javascript files. This works for most
of our checks.The recipe supports the following options:directoryDirectory that is subject to the code analysis.return-status-codesIf set to True, thebin/code-analysisscript returns an error code
that Continuous Integration servers (like Travis CI) can use to fail or
pass a job, based on the code analysis output. Note that Jenkins usually
does not need this option (this is better handled by the Jenkins
Violations plugin). Note that this option does not have any effect on the
other code analysis scripts. Default isFalse.Note that this option can be overridden command-line by using the--return-status-codesor--no-return-status-codescommand-line
options.Note also that the pre-commit and post-commit hooks can be tuned to
have a different status code behavior, if wanted, see below.pre-commit-hookIf set to True, a git pre-commit hook is installed that runs the code
analysis before each commit. Default isTrue.pre-commit-hook-return-status-codesIf set to True, if a pre-commit hook is run it will abort the commit
if violations are found. Default value is the value configured forreturn-status-codes.pre-push-hookIf set to True, a git pre-push hook is installed that runs the code
analysis before it gets pushed to a remote. Default isFalse.pre-push-hook-return-status-codesIf set to True, if a pre-push hook is run it will abort the push
if violations are found. Default value is the value configured forreturn-status-codes.Note that in general it will be advisable to set this option toTrueso you will avoid pushing broken work. YMMV.multiprocessingIf set toTrue,code-analysiswill fork multiple processes and run
all linters in parallel. This will dramatically increase speed on a
multi-core system, specially when usingcode-analysisas pre-commit
hook. Default isFalse.jenkinsIf set to True, the code analysis steps will
write output files that can be processed by theJenkins Violations plugin. Default isFalse.flake8-filesystemIf set to True, the flake8 code analysis step will
write an output file. Ignored if jenkins is True. Default isFalse.flake8If set to True, run Flake8 code analysis. Default isTrue.flake8-extensionsFlake8 now takes advantage offlake8extension system. Default is none.
Ifflake8is set to False, this option will be ignored. Example to
supercharge with some extensions:[code-analysis]recipe=plone.recipe.codeanalysisflake8=Trueflake8-extensions=flake8-blind-exceptflake8-codingflake8-debuggerflake8-quotespep8-namingflake8 SettingsFlake8 uses the following files to look for settings:setup.cfg (recommended for Plone)tox.ini.flake8[flake8]exclude=bootstrap.py,boostrap-buildout.py,docs,*.eggmax-complexity=10max-line-length=79Look atFlake8 documentationand it’s plugins to see which options are available.check-manifestIf set to True,check-manifestwill be run to check you MANIFEST.in
file. Default isFalse.check-manifest-directoryDefault is.which means check the current package where you included
code-analysis in buildout.EXPERIMENTAL: For project buildouts where you use several source
packages you may want to enter multiple directories or use${buildout:develop}to include all your development packages.dependencycheckerIf set to True, import statement analysis is run and verified
against declared dependencies in setup.py. Default isFalse.dependencychecker-binSet the path to a custom version ofdependencychecker.importcheckerIf set to True, import statement analysis is run and unused
imports are reported. Default isFalse.importchecker-binSet the path to a custom version ofimportchecker.jshintIf set to True, jshint code analysis is run. Default isFalse. Note
that plone.recipe.codeanalysis requires jshint >= 1.0.jshint-binJSHint executable. Default isjshint. If you have JSHint installed on
your system and in your path, there is nothing to do. To install JSHint in
your buildout, use the following:[jshint]recipe=gp.recipe.nodenpms=jshintscripts=jshintset jshint-bin to${buildout:bin-directory}/jshint.jshint-excludeAllows you to specify directories which you don’t want to be linted.
Default is none. If you want JSHint to skip some files you can list them
in a file named.jshintignore. SeeJSHint documentationfor more
details.jshint-suppress-warningsBy default warnings of jshint are suppressed and not shown. You may disable
this by setting to False, default isTruefor backward compatibility
reasons.jscsIf set to True, jscs code analysis is run. Default isFalse.JavaScript Code Style options should be configured using a.jscs.jsonfile. You should align your javascript code to the next generation of
Plone’s javascript frameworkMockupand take it’s.jscs.jsonfile
which is available here:https://github.com/plone/mockup/blob/master/mockup/.jscs.jsonAll configuration options are documented on thejscs website.jscs-binSet the path to a custom version of JSCS, e.g./usr/local/bin/jscs.If you have Javascript Code Style Checker installed in your system and
path, you have nothing to do. To install with Buildout, add the following
section to your buildout and set jscs-bin to{buildout:bin-directory}/jscs:[jscs]recipe=gp.recipe.nodenpms=jscsscripts=jscsjscs-excludeAllows you to specify directories and/or files which you don’t want to be
checked. Default is none. Note that these directories have to be given in
absolute paths, use${buildout:directory}/foo/bar/static/js-3rd-partyfor example.csslintIf set to True, CSS Lint code analysis is run. Default isFalse.CSS Lint options should be configured using a.csslintrcfile. A
typical.csslintrcfile will look like this:--format=compact
--quiet
--ignore=adjoining-classes,floats,font-faces,font-sizes,ids,qualified-headings,unique-headings
--exclude-list=foo/bar/static/third-party.cssThis typical configuration includes a list of CSS rules that will be
ignored as they areconsidered useless.SeeCSS Lint documentationandCSS Lint command-line interfacefor a
detailed list and description of the rules.csslint-binSet the path to a custom version of CSS Lint, e.g./usr/local/bin/csslint.If you have CSS Lint installed in your system and path, you have nothing
to do. To install CSS Lint with Buildout, add the following section to
your buildout and set csslint-bin to{buildout:bin-directory}/csslint:[csslint]recipe=gp.recipe.nodenpms=csslintscripts=csslintcsslint-excludeAllows you to specify directories and/or files which you don’t want to be
checked. Default is none.chameleon-lintIf set to True, ChamleonLint code analysis is run. Default isFalse.ChameleonLint useslxmlfor xml parsing. There is nochameleon-lint-bin.Note that you will want to activate eitherchameleon-lintorzpt-lint,
not both, since they will apply to the same set of file extensions (.pt,.cpt,.zpt). Thezpt-lintparser uses the actual TAL expression engine
to validate templates, and this will generally choke on the Chameleon extensions.
Thechameleon-lintparser on the other hand just checks that the template is
valid XML basically.xmllintIf set to True, XMLLint code analysis is run. Default isFalse.XMLLint useslxmlfor xml parsing. There is noxmllint-bin.clean-linesIf set to True,any filecontaining trailing spaces or tabs anywhere
on the lines will cause a warning. Default isFalse.clean-lines-excludeAllows you to specify directories and/or files which you don’t want to be
checked. Default is none.i18ndude, scsslint and zptlint supportTo reduce the number of Zope/Plone direct dependencies, plone.recipe.codeanalysis no longer depends oni18ndudenorSCSS Lintnorzptlint;
in order to use the following options you have to install them on your
system, seebuildout.cfgfor an example install.find-untranslatedIf set to True, scan Zope templates to find untranslated strings.
Default isFalse.
To use this you will need to set thei18ndude-binoption.find-untranslated-excludeAllows you to specify directories and/or files which you don’t want to be
checked. Default is none.find-untranslated-no-summaryThe report will contain only the errors for each file.
Default isFalse.
However, summaries will also be suppressed whenjenkinsis set toTrue.i18ndude-binSet the path to a custom version ofi18ndude.
Default is none.scsslintIf set to True,SCSS Lintcode analysis is run. Default isTrue.scsslint-binSet the path to a custom version ofSCSS Lint.
Default is none.Note that you’ll typically install the gemscss_lint(with underscore)
to get a bin filescss-lint(with a dash).If you have SCSS Lint installed in your system and path, you have nothing
to do. To install SCSS Lint with Buildout, add the following section to
your buildout and set scsslint-bin to{buildout:bin-directory}/scss-lint:[rubygems]recipe=rubygemsrecipegems=scss_lintPlease note that due to some buildout weirdness this will break buildouton the first buildout run; a second buildout run will complete just fine.scsslint-configurationSCSS Lint options can be configured, seeSCSS LintREADME.zptlintIf set to True, zptlint code analysis is run.
Default isFalse.
To use this you will need to set thezptlint-binoption.Note that you will want to use eitherzptlintorchameleon-lint, not both.zptlint-binSet the path to a custom version ofzptlint.
Default is none.zptlint-excludeAllows you to specify directories and/or files which you don’t want to be
checked. Default is none.Self-tests for these extra linters are disabled by default.
To run aplone.recipe.codeanalysisself-test that covers these extra linters:TEST_ALL=true bin/testKnown IssuesJSHint “ERROR: Unknown option –verbose”:JSHint                [ OK ]
ERROR: Unknown option --verboseUpgrade JSHint to latest version (>= 1.0) to fix this issue, e.g.:$ sudo npm install -g jshintJSHint “ERROR: Unknown option –exclude”:JSHint                [ OK ]
ERROR: Unknown option --excludeUpgrade JSHint to latest version (>= 2.1.6) to fix this issue, e.g.:$ sudo npm install -g jshintRubygems woes:Installing rubygems.
rubygems: Extracting package to /app/plone.recipe.codeanalysis/parts
ERROR:  While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /usr/lib/ruby/gems/2.3.0/specifications/default/bundler-1.16.1.gemspec
rubygems: b''
rubygems: Command failed with exit code 1: ['ruby', 'setup.rb', 'all', '--prefix=/app/plone.recipe.codeanalysis/parts/rubygems', '--no-rdoc', '--no-ri']
While:
Installing rubygems.
Error: System errorSolution: run buildout again. Really.Tests fail:Traceback (most recent call last):
File "/app/plone.recipe.codeanalysis/plone/recipe/codeanalysis/__init__.py", line 18, in <module>
import zc.buildout
ModuleNotFoundError: No module named 'zc.buildout'This is likely caused byhttps://github.com/pypa/pip/issues/4695.
Solution: run:bin/easy_install -U zc.buildout==2.11.0before runningbin/buildout.Example usageMinimal buildout:>>> write('buildout.cfg',
... """
... [buildout]
... parts = code-analysis
...
... [code-analysis]
... recipe = plone.recipe.codeanalysis
... directory = %(directory)s
... """ % {
...     'directory' : '${buildout:directory}/plone/recipe/codeanalysis',
... })Running the buildout gives us a ‘code-analysis’ script that runs the entire
code analysis:>>> buildout_output_lower = system(buildout).lower()
>>> '/sample-buildout/bin/code-analysis' in buildout_output_lower
TrueIt is also possible to run single code analysis scripts:>>> '/sample-buildout/bin/code-analysis-flake8' in buildout_output_lower
True
>>> '/sample-buildout/bin/code-analysis-jshint' in buildout_output_lower
TrueFlake 8 is installed by the buildout script, there is no need to install it on
the system:>>> '/sample-buildout/bin/flake8' in buildout_output_lower
TruePre-commit hookIf we have a git repository:>>> import subprocess
>>> subprocess.call(['mkdir', '-p', '.git/hooks'])
0And run buildout again:>>> buildout_output_lower = system(buildout).lower()Then the git pre-commit hook is installed:>>> 'installed git pre-commit hook.' in buildout_output_lower
TrueContributorsTimo Stollenwerk, Original AuthorGil ForcadaHéctor VelardeRamiro Batista da LuzDaniel WiderinMichael DavisChange history3.0.1 (2018-06-27)Fix PyPi readme page.
[timo]3.0.0 (2018-06-27)Re-release of 3.0.0a (brown bag release).
[timo]3.0.0a (2018-06-15)Removed flake8 default settings in favor of using setug.cfg [iham]Add XMLLint for .xml .xsl .zcml files. [janjaapdriessen]Add scss-lint for sass files. [janjaapdriessen]Add a XML linter for Chameleon template files.
[janjaapdriessen]Work around Travis bootstrapping and coverage failures caused byhttps://github.com/buildout/buildout/issues/434andhttps://github.com/pypa/pip/issues/4695, which obscure that the tests
are actually green. Mark python3 builds without extras as critical again.
Note that this requires a double-buildout sequence to get thescss-lintgem properly installed…
Fixes #214.
[gyst]Revive XMLLint, and SCSSLint work by janjaapdriessen.
Add tests and documentation.
[gyst]Replace unmaintainedzptlintupstream byspirit.zptlint.
[gyst]Add tests for Chameleon Linter and fixup the linter.
Fixes #180, sort of; the validation is much less strict than the ZPTLint one.
[gyst]Pull ini18ndudepython3 fixes and mark EXTRAS tests as critical.
[gyst]Updatez3c.dependencycheckerdependency and provide an analyser for it.
No tests for this since it would require a full egg fixture.
Fixes #67.
[gyst]Addimportcheckerlinter.
Fixes #67.
[gyst]Post-merge cleanup of source dependencies for the python3 work.
[gyst]Introduceoverridesto support individual developer preferences.
[gyst]Introducepre-push-hookand allow command-line and githook
deviation from defaultreturn-status-codes.
[gyst]Remove trailing dot from Jenkins output, to ease copy-pasting filenames.
[janwijbrand]Bring our own dogfood linter config and version pins in sync with coredev qa.cfg.
[gyst]2.3 (2018-01-18)Install isort script if flake8-isort is installed as well.
[gforcada]Add a new recommended flake8 plugin:flake8-commas.
[gforcada]Fix Continuous Integration (Travis) by using pip to install setuptools and zc.buildout.
[gforcada]Run tests only once on CI.
[gforcada]Remove bootstrap-buildout.py as it is no longer used.
[gforcada]Fix code analysis errors.
[gforcada]Fix travis (newer setuptools and zc.buildout needed)
[gforcada]Check Python 3.5 and 3.6 in travis as well (although they fail currently).
[gforcada]Add ‘find-untranslated-no-summary’ option for i18ndude.
[tmassman]2.2 (2016-02-20)Fix issue where commit hook did not work on NixOS
(fixed to use/usr/bin/env bashinstead/bin/bash).
[datakurre]Allow to pass a folder where to run code analysis against.
[gforcada]Increase minimum requirement of flake8. Older versions could make
checks with exceptions in plugins as passed.
[do3cc]2.1 (2015-09-21)Remove debug statements checker,flake8-debugger,flake8-printand jshint can do the same job.
[gforcada]Removed pep3101 checker,flake8-pep3101works exactly the same.
[gforcada]Remove deprecated aliases checker,flake8-deprecateddoes the same job.
[gforcada]Remove hasattr checker,flake8-plone-hasattrdoes 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]Remove imports checker,flake8-isortdoes the same job.
[tisto] [gforcada]Fix typo on test that prevented ipdb imports from being found.
[hvelarde]2.0.2 (2015-09-03)Less false positives for pep3101.
[do3cc]Add--jobs=1to flake8 ifmultiprocessingis set toFalse.
[saily]Fix #151 by not instantiatingLockandValueifmultiprocessingwas set toFalse.
[saily]2.0.1 (2015-09-02)synchronize :-)
[do3cc]
Fix multiprocessing bug. Shared state is hard toChange pep3101 logic. No more false positives on log
strings.
[do3cc]Clean tests output.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/122[gforcada]2.0 (2015-08-07)Improve split_lines from analyser which makes exclude statements with more
than one directory to be ignored withzc.buildout 1.7.1.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/129[gil-cano]Allow passing any option to flake8 or its plugins.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/131[gforcada]Create .git/hooks folder if it doesn’t exist.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/124[gforcada]Compile all regexes on initialization to not have to compile them
at every single use, it should make code analysis faster.
[gforcada]2.0b1 (2015-05-03)Allow usage of wildcards in exclude statements.
[saily]Addcheck-manifestas new dependency and a basic check.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/69[saily]Add a new option to disablejshintwarning suppression.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/94[saily]If an executable could not be found the code-analysis always failed. We’ve
changed this behaviour to return True and succeed the code-analysis.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/71[saily]Exclude paths directly infindunix command which speeds up again a lot.
[saily]Exclude empty strings inself.extensionswhich broke install withzc.buildout 1.7.1.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/115[saily]Add check for relative imports.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/44[saily]2.0a2 (2015-04-30)Replace manual comparisons of buildout options toFalsewith abool_optionmethod.
[saily]Removed some plugins and replaced them withflake8plugins. Please
not the API change in buildout. Following options have been removed:utf8-headershas been removed, replace it withflake8-codingif
needed.utf8-headers-excludeprefer-single-quoteshas been removed, replace it withflake8-quotes.prefer-single-quotes-excludedebug-statementshas some reduced functionality, because python
debugger checks should be included usingflake8-debuggerextension which
also checks foripdb.Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/112[saily]Add missing tests for deprecated_aliases parser.
[saily]Add new double quotes parser and add test for it. It now also supports
# noqa statments and nested quotes.
[saily]2.0a1 (2015-04-27)Added multiprocessing. This will dramatically increase speed on large
packages when using pre-commit hooks.
[saily]Return correct exit codes for console-scripts.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/66[saily]Refactor whole linters framework to use OO design patterns, inherit fromAnalyserabstract base class.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/62[saily]Add bootstrap-buildout.py to flake8-exclude default. zc.buildout > 2 uses
bootstrap-buildout.py instead of bootstrap.py.
[timo]1.1 (2014-12-04)Add a check to look for hasattr() calls, which are considered bad practice.
[gforcada, jensens]Add option to store flake8 output if jenkins is False
[Michael Davis]Fix find_files from utils to find files, not directories
[do3cc]1.0 (2014-12-04)Nothing changed since 1.0rc1.1.0rc1 (2014-06-18)Return a string to avoid TypeError when no file was checked withjscs.
[saily]Check import sorting incode_analysis_importsand add tests for
clean and sorted imports.
[saily]Refactorcode_analysis_clean_linesto use a new method to retrieve
files and avoid too complex violation.
[saily]1.0b8 (2014-06-05)Addclean-lines-excludesupport and updated README.
[saily]Added tests for clean-lines checks.
[saily]Use indices for format() to support Python 2.6.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/77[timo]1.0b7 (2014-05-04)Add Javascript Code Style Checkerjscssupport.
[saily]Remove hard dependency on i18ndude and zptlint; this will reduce the number
of Zope/Plone direct dependencies to make life happier to people using
Pyramid and other web Python-based development frameworks.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/53[hvelarde]Do not print out jshint and csslint output for Jenkins. Those files can
become quite large.
[timo]1.0b6 (2013-10-16)Remove progress bullets from flake8 check.
[timo]Improve the way to handle an exception if the command used in popen does
not exist.
[flohcim]1.0b5 (2013-10-08)Fix code analysis method by making it call each check only if the option
is activated.
[flohcim]Keep backward compatibility with ‘string-formatting’ option.
[hvelarde]Rename ‘deprecated-alias’ to ‘deprecated-aliases’ and keep backward
compatibility.
[hvelarde]1.0b4 (2013-10-06)Implement Jenkins option on CSS Lint and JSHint.
[hvelarde, ramiroluz]Rename ‘deprecated-methods’ to ‘deprecated-alias’.
[gforcada]Rename ‘string-formatting’ option to ‘pep3101’ to keep consistency.
[hvelarde]Remove unused CSSLINT_IGNORE remainings.
[timo]Simplify code analysis method and make it more readable.
[timo]1.0b3 (2013-09-12)Add return-status-codes option that allows to fail a CI-build on Travis.
[timo]Make system wide installed csslint the default value for
the csslint-bin option.
[timo]1.0b2 (2013-09-11)Deprecate ‘csslint-quiet’, ‘csslint-ignore’ and ‘csslint-exclude-list’
options; CSS Lint must be configured now using a ‘.csslintrc’ file.
‘csslint-bin’ option now defaults tobin/csslint; documentation was
updated (closes #20).
[hvelarde]Implement removal of pre-commit hook.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/21[hvelarde]1.0b1 (2013-08-12)Workaround over JSHint limitations to avoid displaying warning messages as
errors.
Fixeshttps://github.com/plone/plone.recipe.codeanalysis/issues/13[hvelarde]Fix CSS Lint validation and implement new ‘csslint-quiet’ option.
[hvelarde]Fix package distribution.
[hvelarde]1.0a1 (2013-08-04)Initial release.
[timo]