From 02475f30342fcf0d9c704c00dfed20cfb58ae258 Mon Sep 17 00:00:00 2001 From: "Elf M. Sternberg" Date: Mon, 3 Oct 2016 17:31:52 -0700 Subject: [PATCH] That's SO much better. --- .gitignore | 3 + Makefile | 99 +- README.rst | 91 - _modules/git_lint/reporters.html | 171 - arguments.html | 45 +- authors.html | 45 +- contributing.html | 63 +- docs/Makefile | 177 - docs/arguments.rst | 32 - docs/authors.rst | 1 - docs/conf.py | 275 - docs/contributing.rst | 1 - docs/git_lint.rst | 46 - docs/history.rst | 1 - docs/index.rst | 27 - docs/installation.rst | 52 - docs/make.bat | 242 - docs/manual.rst | 56 - docs/modules.rst | 7 - docs/readme.rst | 1 - docs/strategies.rst | 32 - docs/usage.rst | 36 - genindex.html | 33 +- git_lint.html | 107 +- git_lint/__init__.py | 7 - git_lint/__main__.py | 71 - git_lint/git_lint.py | 463 - git_lint/option_handler.py | 87 - git_lint/options.py | 39 - git_lint/reporters.py | 82 - history.html | 45 +- index.html | 53 +- installation.html | 57 +- manual.html | 55 +- modules.html | 45 +- {_modules => modules}/git_lint/git_lint.html | 337 +- .../git_lint/option_handler.html | 85 +- modules/git_lint/reporters.html | 172 + {_modules => modules}/index.html | 41 +- objects.inv | Bin 760 -> 576 bytes py-modindex.html | 53 +- readme.html | 45 +- search.html | 24 +- searchindex.js | 2 +- {_sources => sources}/arguments.txt | 0 {_sources => sources}/authors.txt | 0 {_sources => sources}/contributing.txt | 0 {_sources => sources}/git_lint.txt | 0 {_sources => sources}/history.txt | 0 {_sources => sources}/index.txt | 0 {_sources => sources}/installation.txt | 0 {_sources => sources}/manual.txt | 0 {_sources => sources}/modules.txt | 0 {_sources => sources}/readme.txt | 0 {_sources => sources}/strategies.txt | 0 {_sources => sources}/usage.txt | 0 static/basic.css | 87 +- static/classic.css | 261 - static/default.css | 257 +- static/doctools.js | 55 +- static/down-pressed.png | Bin 347 -> 368 bytes static/down.png | Bin 347 -> 363 bytes static/file.png | Bin 358 -> 392 bytes static/jquery-1.11.1.js | 10308 ---------------- static/jquery.js | 9408 +++++++++++++- static/minus.png | Bin 173 -> 199 bytes static/plus.png | Bin 173 -> 199 bytes static/pygments.css | 3 - static/searchtools.js | 53 +- static/sidebar.js | 2 +- static/underscore-1.3.1.js | 999 -- static/underscore.js | 1257 +- static/up-pressed.png | Bin 345 -> 372 bytes static/up.png | Bin 345 -> 363 bytes static/websupport.js | 32 +- strategies.html | 55 +- usage.html | 95 +- 77 files changed, 11757 insertions(+), 14521 deletions(-) delete mode 100644 README.rst delete mode 100644 _modules/git_lint/reporters.html delete mode 100644 docs/Makefile delete mode 100644 docs/arguments.rst delete mode 100644 docs/authors.rst delete mode 100644 docs/conf.py delete mode 100644 docs/contributing.rst delete mode 100644 docs/git_lint.rst delete mode 100644 docs/history.rst delete mode 100644 docs/index.rst delete mode 100644 docs/installation.rst delete mode 100644 docs/make.bat delete mode 100644 docs/manual.rst delete mode 100644 docs/modules.rst delete mode 100644 docs/readme.rst delete mode 100644 docs/strategies.rst delete mode 100644 docs/usage.rst delete mode 100644 git_lint/__init__.py delete mode 100644 git_lint/__main__.py delete mode 100644 git_lint/git_lint.py delete mode 100644 git_lint/option_handler.py delete mode 100644 git_lint/options.py delete mode 100644 git_lint/reporters.py rename {_modules => modules}/git_lint/git_lint.html (75%) rename {_modules => modules}/git_lint/option_handler.html (73%) create mode 100644 modules/git_lint/reporters.html rename {_modules => modules}/index.html (64%) rename {_sources => sources}/arguments.txt (100%) rename {_sources => sources}/authors.txt (100%) rename {_sources => sources}/contributing.txt (100%) rename {_sources => sources}/git_lint.txt (100%) rename {_sources => sources}/history.txt (100%) rename {_sources => sources}/index.txt (100%) rename {_sources => sources}/installation.txt (100%) rename {_sources => sources}/manual.txt (100%) rename {_sources => sources}/modules.txt (100%) rename {_sources => sources}/readme.txt (100%) rename {_sources => sources}/strategies.txt (100%) rename {_sources => sources}/usage.txt (100%) delete mode 100644 static/classic.css delete mode 100644 static/jquery-1.11.1.js delete mode 100644 static/underscore-1.3.1.js diff --git a/.gitignore b/.gitignore index d7b2df7..e2db256 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,6 @@ docs/_build/ # PyBuilder target/ + +# Source +master/ diff --git a/Makefile b/Makefile index bdca640..95973e5 100644 --- a/Makefile +++ b/Makefile @@ -1,93 +1,24 @@ .PHONY: clean-pyc clean-build docs clean -define BROWSER_PYSCRIPT -import os, webbrowser, sys -try: - from urllib import pathname2url -except: - from urllib.request import pathname2url - -webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) -endef -export BROWSER_PYSCRIPT -BROWSER := python -c "$$BROWSER_PYSCRIPT" help: - @echo "all - local build including docs" - @echo "clean - remove all build, test, coverage and Python artifacts" - @echo "clean-build - remove build artifacts" - @echo "clean-pyc - remove Python file artifacts" - @echo "clean-test - remove test and coverage artifacts" - @echo "lint - check style with flake8" - @echo "test - run tests quickly with the default Python" - @echo "test-all - run tests on every Python version with tox" - @echo "coverage - check code coverage quickly with the default Python" @echo "docs - generate Sphinx HTML documentation, including API docs" - @echo "docsbrowse - generate Sphinx HTML documentation and start browser" - @echo "release - package and upload a release" - @echo "dist - package" - @echo "install - install the package to the active Python's site-packages" -all: docs - python setup.py build +master: + git clone -b master `git config --get remote.origin.url` master -clean: clean-build clean-pyc clean-test +docs: master + cd master && git pull origin master && make docs + mv master/docs/_build/html/* . + mv _modules modules + mv _static static + mv _sources sources + perl -pi.bak -e 's/_sources/sources/g; s/_static/static/g; s/_modules/modules/g' *.html modules/*.html modules/*/*.html + rm *.html.bak modules/*.html.bak modules/*/*.html.bak -clean-build: - rm -fr build/ - rm -fr dist/ - rm -fr .eggs/ - find . -name '*.egg-info' -exec rm -fr {} + - find . -name '*.egg' -exec rm -f {} + +clean: + rm *.html + rm -fr modules static sources -clean-pyc: - find . -name '*.pyc' -exec rm -f {} + - find . -name '*.pyo' -exec rm -f {} + - find . -name '*~' -exec rm -f {} + - find . -name '__pycache__' -exec rm -fr {} + +realclean: + rm -fr master -clean-test: - rm -fr .tox/ - rm -f .coverage - rm -fr htmlcov/ - -lint: - flake8 git_lint tests - -test: - py.test - - -test-all: - tox - -coverage: - coverage run --source git_lint py.test - coverage report -m - coverage html - $(BROWSER) htmlcov/index.html - -docs: - rm -f docs/git_lint.rst - rm -f docs/modules.rst - sphinx-apidoc -o docs/ git_lint - $(MAKE) -C docs clean - $(MAKE) -C docs html - $(MAKE) -C docs man - -docbrowse: docs - $(BROWSER) docs/_build/html/index.html - -servedocs: docs - watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . - -release: clean - python setup.py sdist upload - python setup.py bdist_wheel upload - -dist: clean - python setup.py sdist - python setup.py bdist_wheel - ls -l dist - -install: clean - python setup.py install --prefix=/usr/local diff --git a/README.rst b/README.rst deleted file mode 100644 index 042873f..0000000 --- a/README.rst +++ /dev/null @@ -1,91 +0,0 @@ -=============================== -Git Lint: README -=============================== - -A git command that automatically runs identifiable linters against -changed files in your current git repository or staging area. - -* Free software: MIT license - -**Git Lint** runs a configurable set of syntax, style, and complexity -checkers against changed files in your current working directory or -staging area. It can be configured to work with any `lint`-like -command. Some commands may require shell wrappers. - -While it may be possible to create a custom lint command in your npm, -grunt, Make, CMake, or whatever, the fact is we all use a VCS, and most -of us use git. Having a centralized repository for what we want checked -and how we want it checked, associated with git (and by extension, as a -pre-commit hook), that can be run at any time for any reason. - -Usage ------ - -To lint only what's changed recently in your current working directory: - `git lint` - -To lint everything, changed or otherwise, from the current directory down: - `git lint -a` - -To lint what's changed from the repo's base: - `git lint -b` - -To lint what's in your staging directory: - `git lint -s` - - -Install -------- - - `pip install git-linter` - -You will need to copy the .git-lint configuration file to either your -home directory or the repo`s base directory. Edit the configuration -file as needed. You will also need any linters that you plan on -running. - - -Features --------- - -* Highly configurable - configuration files, both for git-lint and - individual linters, can be global or per-project. - -* Only checks files that have been changed, but this can be overriden - from the command line. - -* Can be used directly as a pre-commit hook, to ensure you personally - don't check in anything broken. - - * Used this way, it checks the *staging* area, not your workspace. - - * When using the staging area, it stashes your current work. Upon - restoration of your workspace, it ensures the timestamps are the - same, so as not to confuse your build system or IDE. - - -Acknowledgements ----------------- -`Git lint` started life as a simple pre-commit hook. Most of the -changes since were inspired by Steve Pulec's *`Why You Need a Git -Pre-Commit Hook and Why Most Are Wrong`_ ,* as well as just my own needs as -a software developer. - -.. _Why You Need a Git Pre-Commit Hook and Why Most Are Wrong: https://dzone.com/articles/why-your-need-git-pre-commit - - -Disclaimer ----------- - -This software, including provided configuration and documentation -materials, is provided "as is" without any warranties, including any -implied warranties of merchantability, fitness, performance, or -quality. In no event shall the author or sponsor be liable for any -special, direct, indirect, or consequential damages or any damages -whatsoever resulting from loss of use, data or profits, whether in an -action of contract, negligence or other tortious action, arising out -of or in connection with the use or performance of this software. -Each user of the program will agree and understand, and be deemed to -have agreed and understood, that there is no warranty whatsoever for -the program and, accordingly, the entire risk arising from or -otherwise connected with the program is assumed by the user. diff --git a/_modules/git_lint/reporters.html b/_modules/git_lint/reporters.html deleted file mode 100644 index eb41778..0000000 --- a/_modules/git_lint/reporters.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - git_lint.reporters — Git Lint 0.0.4 documentation - - - - - - - - - - - - - - -
-
-
-
- -

Source code for git_lint.reporters

-from __future__ import print_function
-from .git_lint import load_config, run_linters, git_base
-import operator
-import gettext
-_ = gettext.gettext
-
-
-
[docs]def base_file_cleaner(files): - return [file.replace(git_base + '/', '', 1) for file in files]
- - -# ICK. Mutation, references, and hidden assignment. -
[docs]def group_by(iterable, field_id): - results = [] - keys = {} - for obj in iterable: - key = obj[field_id] - if key in keys: - keys[key].append(obj) - continue - keys[key] = [obj] - results.append((key, keys[key])) - return results
- - - - - - - - - - - - - - -
- -
-
-
- -
-
- - - - \ No newline at end of file diff --git a/arguments.html b/arguments.html index 6825bd9..f50b0a5 100644 --- a/arguments.html +++ b/arguments.html @@ -6,9 +6,9 @@ - <no title> — Git Lint 0.0.4 documentation + <no title> — Git Lint 0.0.4 documentation - + - -