{ "info": { "author": "Henning Jacobs", "author_email": "henning@jacobs1.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Pre-processors", "Topic :: Text Processing :: Markup :: XML" ], "description": "=============\ncodevalidator\n=============\n\nSimple source code validator with file reformatting option (remove trailing WS, pretty print XML, ..).\n\nFor Python code formatting it can either use autopep8_ or the builtin copy of PythonTidy.\n\nRequirements\n------------\n\n* Python 2.7+\n* lxml_ (for XML formatting)\n* pep8_ (for Python checking)\n* autopep8_ (for Python formatting)\n* pyflakes_ (for static Python code checking)\n* Jalopy_ (for Java code formatting)\n* coffeelint (for CoffeeScript validation)\n* PHP_CodeSniffer (for PHP style checking)\n* Puppet (for Puppet manifest validation)\n* sqlparse\n* jshint (for JavaScript checking)\n* PyYAML (for YAML checking)\n* Ruby (for Ruby code checking)\n* Rubygems (for Ruby code checking with rubocop)\n* erb and ruby (for ERB template checking)\n\nOn Ubuntu you can install most packages easily::\n\n sudo apt-get install python-lxml pep8 pyflakes nodejs npm python-sqlparse python-yaml ruby rubygems\n sudo npm install -g jshint\n sudo gem i rubocop\n\nIf you are using Jalopy, for better performance also install Nailgun::\n\n sudo apt-get install nailgun\n\nAnd start the nailgun server with::\n\n java -cp /usr/share/java/nailgun-0.9.0.jar:/opt/jalopy/lib/jalopy-1.9.4.jar -server com.martiansoftware.nailgun.NGServer\n\nInstallation\n------------\n\nThere are at least two ways of installing codevalidator:\n\n* Alternative 1: Use the codevalidator source tree directly (i.e. clone the GIT repo and put codevalidator.py in your ``PATH``)::\n\n git clone https://github.com/hjacobs/codevalidator.git\n sudo ln -s codevalidator/codevalidator.py /usr/local/bin/codevalidator.py\n\n* Alternative 2: Install codevalidator from PyPI using PIP::\n\n sudo pip install codevalidator\n\n* Alternative 3: Use Docker_ to get all dependencies and to run codevalidator without messing with your local system::\n\n docker build -t codevalidator .\n # we can mount the current directory into \"workdir\" volume to validate the local directory recursively\n docker run -v `pwd`:/workdir -t codevalidator -rvv /workdir/\n\n\n\nGetting Started\n---------------\n\nValidating test files with builtin default configuration::\n\n ./codevalidator.py test/*\n\nFixing test files (removing trailing whitespace, XML format)::\n\n ./codevalidator.py -f test/*\n\nUsing custom configuration file::\n\n ./codevalidator.py -c test/config.json test/*\n\nValidate and fix a whole directory tree::\n\n ./codevalidator.py -c myconfig.json -rf /path/to/mydirectory\n\nValidate a single PHP file and print detailed error messages (needs PHP_CodeSniffer with PSR standards installed!)::\n\n ./codevalidator.py -v test/test.php\n\nRunning in very verbose (debug) mode to see what is validated::\n\n ./codevalidator.py -vvrc test/config.json test\n\nUsing the filter mode to \"fix\" stdin and write to stdout::\n\n echo 'print 1' | ./codevalidator.py --fix --filter foobar.py && echo success\n\nIf you are annoyed by the .XX.pre-cvfix backup files you can disable them either on the command line (``--no-backup``) or in the config file.\n\nConfiguration\n-------------\n\nCodevalidator uses a mapping of file name patterns to \"rules\" in order to know which validation rules should be applied for a certain file.\nThe script contains a more-or-less sane default configuration (see ``DEFAULT_CONFIG`` at the top of ``codevalidator.py``).\nYou can overwrite the configuration by putting a ``.codevalidatorrc`` file in your home directory.\nThe file must be JSON and must have the same structure as ``DEFAULT_CONFIG``.\n\nAdvanced Usages\n---------------\n\nYou can use the ``--fix --filter`` combination to directly filter your current buffer in VIM::\n\n :%!codevalidator.py --fix --filter %\n\nThe ``--fix --filter`` was also designed to be used with `GIT filters`_.\n\nTo apply a formatting rule once without changing you configuration file, you can use the ``-a`` option. Formatting a Python file once with the ``pythontidy`` rule looks like::\n\n ./codevalidator.py -a pythontidy myfile.py\n\n\nKnown Issues\n------------\n\n* PythonTidy cannot parse `dict comprehensions`_. As a workaround you can use list comprehensions and wrap it with ``dict``.\n\n.. _lxml: http://lxml.de/\n.. _pep8: https://pypi.python.org/pypi/pep8\n.. _autopep8: https://pypi.python.org/pypi/autopep8\n.. _pyflakes: https://pypi.python.org/pypi/pyflakes\n.. _Jalopy: http://www.triemax.com/products/jalopy/\n.. _dict comprehensions: http://www.python.org/dev/peps/pep-0274/\n.. _GIT filters: https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html\n.. _Docker: https://www.docker.com/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hjacobs/codevalidator", "keywords": "formatter,beautify,indentation", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "codevalidator", "package_url": "https://pypi.org/project/codevalidator/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/codevalidator/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/hjacobs/codevalidator" }, "release_url": "https://pypi.org/project/codevalidator/0.8.2/", "requires_dist": null, "requires_python": null, "summary": "Simple source code validator with file reformatting option (remove trailing WS, pretty print XML, ..)", "version": "0.8.2" }, "last_serial": 1579595, "releases": { "0.8": [ { "comment_text": "", "digests": { "md5": "119fd2b2929d37d5fe212c6d9ffec3d2", "sha256": "10cc1b3ea3edd11db4b00bb0b7e3ef5f32379bf23ee5c58594df6148f626a90c" }, "downloads": -1, "filename": "codevalidator-0.8.tar.gz", "has_sig": false, "md5_digest": "119fd2b2929d37d5fe212c6d9ffec3d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32881, "upload_time": "2014-05-04T11:22:04", "url": "https://files.pythonhosted.org/packages/ac/58/7493f7b21689422ad8e5532169115d6278bf98ff86a7c99c2f4e14099de7/codevalidator-0.8.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "641b5222c5314a661d52e3d81a770fd0", "sha256": "1138b90c37ae7b2c251faaa7c4613d30725ccc085b04fd8e764499800acebd6c" }, "downloads": -1, "filename": "codevalidator-0.8.1.tar.gz", "has_sig": false, "md5_digest": "641b5222c5314a661d52e3d81a770fd0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35632, "upload_time": "2014-05-04T12:10:07", "url": "https://files.pythonhosted.org/packages/8e/5f/724cb10d144bba6bf7fafb8469cbd01044e4330e7ea64257663a0258b6a5/codevalidator-0.8.1.tar.gz" } ], "0.8.2": [ { "comment_text": "", "digests": { "md5": "8f5b9e90f4d168c089f082711a98b1ba", "sha256": "82fffaf0637bf691a8f896d9c66cf7c2d94eb03e7bcb46850aff2e082fd6d415" }, "downloads": -1, "filename": "codevalidator-0.8.2.tar.gz", "has_sig": false, "md5_digest": "8f5b9e90f4d168c089f082711a98b1ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38173, "upload_time": "2015-06-05T10:20:31", "url": "https://files.pythonhosted.org/packages/b9/5f/71cfe7cae87ffea2ace6e1c24c681ad2ab9a66c172bdf1f39e6a391ca61b/codevalidator-0.8.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8f5b9e90f4d168c089f082711a98b1ba", "sha256": "82fffaf0637bf691a8f896d9c66cf7c2d94eb03e7bcb46850aff2e082fd6d415" }, "downloads": -1, "filename": "codevalidator-0.8.2.tar.gz", "has_sig": false, "md5_digest": "8f5b9e90f4d168c089f082711a98b1ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38173, "upload_time": "2015-06-05T10:20:31", "url": "https://files.pythonhosted.org/packages/b9/5f/71cfe7cae87ffea2ace6e1c24c681ad2ab9a66c172bdf1f39e6a391ca61b/codevalidator-0.8.2.tar.gz" } ] }