45438528761b0bbc143f8f2f013ee01917eb48cc

Author
Gaetan Semet <gaetan@xeberon.net>
Committer
Gaetan Semet <gaetan@xeberon.net>
Date

Message

Completion for python, pep8, autopep8 and pylint

Signed-off-by: Gaetan Semet <gaetan@xeberon.net>

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/autopep8/_autopep8 b/plugins/autopep8/_autopep8
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..c14d06d66814063de56e628b08d269b2d92019b5
  4--- /dev/null
  5+++ b/plugins/autopep8/_autopep8
  6@@ -0,0 +1,32 @@
  7+#compdef autopep8
  8+#
  9+# this is zsh completion function file.
 10+# generated by genzshcomp(ver: 0.5.1)
 11+#
 12+
 13+typeset -A opt_args
 14+local context state line
 15+
 16+_arguments -s -S \
 17+  "--help[show this help message and exit]:" \
 18+  "-h[show this help message and exit]:" \
 19+  "--version[show program's version number and exit]:" \
 20+  "--verbose[print verbose messages; multiple -v result in more verbose messages]" \
 21+  "-v[print verbose messages; multiple -v result in more verbose messages]" \
 22+  "--diff[print the diff for the fixed source]" \
 23+  "-d[print the diff for the fixed source]" \
 24+  "--in-place[make changes to files in place]" \
 25+  "-i[make changes to files in place]" \
 26+  "--recursive[run recursively; must be used with --in-place or --diff]" \
 27+  "-r[run recursively; must be used with --in-place or --diff]" \
 28+  "--jobs[number of parallel jobs; match CPU count if value is less than 1]::n        number of parallel jobs; match CPU count if value is:_files" \
 29+  "-j[number of parallel jobs; match CPU count if value is less than 1]::n        number of parallel jobs; match CPU count if value is:_files" \
 30+  "--pep8-passes[maximum number of additional pep8 passes (default: 100)]::n:_files" \
 31+  "-p[maximum number of additional pep8 passes (default: 100)]::n:_files" \
 32+  "-a[-a result in more aggressive changes]::result:_files" \
 33+  "--exclude[exclude files/directories that match these comma- separated globs]::globs:_files" \
 34+  "--list-fixes[list codes for fixes; used by --ignore and --select]" \
 35+  "--ignore[do not fix these errors/warnings (default E226,E24)]::errors:_files" \
 36+  "--select[fix only these errors/warnings (e.g. E4,W)]::errors:_files" \
 37+  "--max-line-length[set maximum allowed line length (default: 79)]::n:_files" \
 38+  "*::args:_files"
 39diff --git a/plugins/autopep8/autopep8.plugin.zsh b/plugins/autopep8/autopep8.plugin.zsh
 40new file mode 100644
 41index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
 42--- /dev/null
 43+++ b/plugins/autopep8/autopep8.plugin.zsh
 44diff --git a/plugins/pep8/_pep8 b/plugins/pep8/_pep8
 45new file mode 100644
 46index 0000000000000000000000000000000000000000..ce19951dcaae89169e28443de91869b199ca8832
 47--- /dev/null
 48+++ b/plugins/pep8/_pep8
 49@@ -0,0 +1,34 @@
 50+#compdef pep8
 51+#
 52+# this is zsh completion function file.
 53+# generated by genzshcomp(ver: 0.5.1)
 54+#
 55+
 56+typeset -A opt_args
 57+local context state line
 58+
 59+_arguments -s -S \
 60+  "--help[show this help message and exit]:" \
 61+  "-h[show this help message and exit]:" \
 62+  "--version[show program's version number and exit]:" \
 63+  "--verbose[print status messages, or debug with -vv]" \
 64+  "-v[print status messages, or debug with -vv]" \
 65+  "--quiet[report only file names, or nothing with -qq]" \
 66+  "-q[report only file names, or nothing with -qq]" \
 67+  "--repeat[(obsolete) show all occurrences of the same error]" \
 68+  "-r[(obsolete) show all occurrences of the same error]" \
 69+  "--first[show first occurrence of each error]" \
 70+  "--exclude[exclude files or directories which match these comma separated patterns (default: .svn,CVS,.bzr,.hg,.git,__pycache__)]::patterns:_files" \
 71+  "--filename[when parsing directories, only check filenames matching these comma separated patterns (default: *.py)]::patterns:_files" \
 72+  "--select[select errors and warnings (e.g. E,W6)]::errors:_files" \
 73+  "--ignore[skip errors and warnings (e.g. E4,W)]::errors:_files" \
 74+  "--show-source[show source code for each error]" \
 75+  "--show-pep8[show text of PEP 8 for each error (implies --first)]" \
 76+  "--statistics[count errors and warnings]" \
 77+  "--count[print total number of errors and warnings to standard error and set exit code to 1 if total is not null]" \
 78+  "--max-line-length[set maximum allowed line length (default: 79)]::n:_files" \
 79+  "--format[set the error format \[default|pylint|<custom>\]]::format:_files" \
 80+  "--diff[report only lines changed according to the unified diff received on STDIN]" \
 81+  "--benchmark[measure processing speed   are read from the \[pep8\] section of the tox.ini fg file located in any parent folder of the path(s) llowed options are: exclude, filename, select, ngth, count, format, quiet, show-pep8, show-source, .]" \
 82+  "--config[user config file location (default: /home/gsemet/.config/pep8)]::path:_files" \
 83+  "*::args:_files"
 84diff --git a/plugins/pylint/_pylint b/plugins/pylint/_pylint
 85new file mode 100644
 86index 0000000000000000000000000000000000000000..e466d051b6be056ad85a16b5ae1983957101ce31
 87--- /dev/null
 88+++ b/plugins/pylint/_pylint
 89@@ -0,0 +1,31 @@
 90+#compdef pylint
 91+#
 92+# this is zsh completion function file.
 93+# generated by genzshcomp(ver: 0.5.1)
 94+#
 95+
 96+typeset -A opt_args
 97+local context state line
 98+
 99+_arguments -s -S \
100+  "--help[show this help message and exit]:" \
101+  "-h[show this help message and exit]:" \
102+  "--version[show program's version number and exit]:" \
103+  "--long-help[more verbose help.]" \
104+  "--rcfile[Specify a configuration file.]::<file>:_files" \
105+  "--errors-only[In error mode, checkers without error messages are disabled and for others, only the ERROR messages are displayed, and no reports are done by default]" \
106+  "-E[In error mode, checkers without error messages are disabled and for others, only the ERROR messages are displayed, and no reports are done by default]" \
107+  "--ignore[Add files or directories to the blacklist. They should be base names, not paths. \[current: CVS\]]::<file>[,<file>...]:_files" \
108+  "--help-msg[Display a help message for the given message id and exit. The value may be a comma separated list of message ids.]::<msg-id>:_files" \
109+  "--generate-rcfile[Generate a sample configuration file according to the current configuration. You can put other options before this one to get them in the generated configuration.]" \
110+  "--enable[Enable the message, report, category or checker with the given id(s). You can either give multiple identifier separated by comma (,) or put this option multiple time.]::<msg ids>:_files" \
111+  "-e[Enable the message, report, category or checker with the given id(s). You can either give multiple identifier separated by comma (,) or put this option multiple time.]::<msg ids>:_files" \
112diff --git a/plugins/pylint/pylint.plugin.zsh b/plugins/pylint/pylint.plugin.zsh
113new file mode 100644
114index 0000000000000000000000000000000000000000..6760c67b080ec98f6d58f1ab8a7bbbe8e8ab4db3
115--- /dev/null
116+++ b/plugins/pylint/pylint.plugin.zsh
117@@ -0,0 +1,3 @@
118+# Aliases
119+alias pylint-quick='pylint --reports=n --include-ids=y'
120+compdef _pylint-quick pylint-quick='pylint --reports=n --include-ids=y'
121diff --git a/plugins/python/_python b/plugins/python/_python
122new file mode 100644
123index 0000000000000000000000000000000000000000..f517d4806b7f761dd675e8ee80569d8c29a7015c
124--- /dev/null
125+++ b/plugins/python/_python
126@@ -0,0 +1,54 @@
127+#compdef python
128+
129+# Python 2.6
130+# Python 3.0
131+
132+local curcontext="$curcontext" state line expl
133+typeset -A opt_args
134+
135+local -a args
136+
137+if _pick_variant python3=Python\ 3 python2 --version; then
138+  args=(
139+    '(-bb)-b[issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]'
140+    '(-b)-bb[issue errors about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]'
141+  )
142+else
143+  args=(
144+    '-Q+[division options]:division option:(old warn warnall new)'
145+    '(-tt)-t[issue warnings about inconsistent tab usage]'
146+    '(-t)-tt[issue errors about inconsistent tab usage]'
147+    '-3[warn about Python 3.x incompatibilities]'
148+  )
149+fi
150+
151+_arguments -C -s -S "$args[@]" \
152+  "-B[don't write .py\[co\] files on import]" \
153+  '(1 -)-c+[program passed in as string (terminates option list)]:python command:' \
154+  '-d[debug output from parser]' \
155+  '-E[ignore PYTHON* environment variables (such as PYTHONPATH)]' \
156+  '(1 * -)-h[display help information]' \
157+  '-i[inspect interactively after running script]' \
158+  '(1 * -)-m[run library module as a script (terminates option list)]:module:->modules' \
159+  '-O[optimize generated bytecode slightly]' \
160+  '-OO[remove doc-strings in addition to the -O optimizations]' \
161+  "-s[don't add user site directory to sys.path]" \
162+  "-S[don't imply 'import site' on initialization]" \
163+  '-u[unbuffered binary stdout and stderr]' \
164+  '-v[verbose (trace import statements)]' \
165+  '(1 * -)'{-V,--version}'[display version information]' \
166+  '-W+[warning control]:warning filter (action\:message\:category\:module\:lineno):(default always ignore module once error)' \
167+  '-x[skip first line of source, allowing use of non-Unix forms of #!cmd]' \
168+  '(-)1:script file:_files -g "*.py(|c|o)(-.)"' \
169+  '*::script argument: _normal' && return
170+
171+if [[ "$state" = modules ]]; then
172+  local -a modules
173+  modules=(
174+    ${${=${(f)"$(_call_program modules $words[1] -c \
175+      'from\ pydoc\ import\ help\;\ help\(\"modules\"\)')"}[2,-3]}:#\(package\)}
176+  )
177+  _wanted modules expl module compadd -a modules && return
178+fi
179+
180+return 1
181diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh
182index 852c8b919ed77a45d68b0a57535b9b8995a8f8dd..319bf0bf03785170ea9ebd45f8b738f620924f7f 100644
183--- a/plugins/python/python.plugin.zsh
184+++ b/plugins/python/python.plugin.zsh
185@@ -10,3 +10,4 @@ function pyclean() {
186 
187 # Grep among .py files
188 alias pygrep='grep --include="*.py"'
189+