|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 | +<plist version="1.0"> |
| 4 | +<dict> |
| 5 | + <key>beforeRunningCommand</key> |
| 6 | + <string>nop</string> |
| 7 | + <key>command</key> |
| 8 | + <string>#!/bin/bash |
| 9 | +[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" |
| 10 | +
|
| 11 | +. "$TM_SUPPORT_PATH/lib/webpreview.sh" |
| 12 | +html_header "Python Bundle Help" "Python" |
| 13 | +
|
| 14 | +Markdown.pl <<'EOF' |
| 15 | +
|
| 16 | +## Integrating a Python checker |
| 17 | +
|
| 18 | +Python includes a rudimentary syntax checker but this can be improved by installing a secondary checker. Start by installing your checker in the usual way; for Pylint, for example: |
| 19 | +
|
| 20 | + pip install pylint |
| 21 | +
|
| 22 | +In *Preferences*, select the *Variables* tab. If a `TM_PYCHECKER` variable is not already listed, |
| 23 | +add it, with the appropriate value (one of `pylint`, `pychecker`, `pyflakes`, `pep8`, |
| 24 | +`flake8`). |
| 25 | +
|
| 26 | +The default keyboard shortcut to run the syntax checker is *Control-Shift-V* - open a `.py` file |
| 27 | +in TextMate, and try it. |
| 28 | +
|
| 29 | +You should see the output in a new window (this example uses Pylint): |
| 30 | +
|
| 31 | + PyCheckMate 1.2 – Pylint 1.4.4 |
| 32 | + |
| 33 | + No config file found, using default configuration |
| 34 | +
|
| 35 | +Then all is well, and most likely the checker will have expressed some opinions about your Python |
| 36 | +code (or will exit with `0` if your code already conforms to its expectations). |
| 37 | +
|
| 38 | +If you receive a message: |
| 39 | +
|
| 40 | + Please install PyChecker, PyFlakes, Pylint, PEP 8 or flake8 |
| 41 | + for more extensive code checking. |
| 42 | +
|
| 43 | +That means that no checker wasn't found, which is likely an issue with command paths. Check where your checker program has been installed, using `which`, for example: |
| 44 | +
|
| 45 | + $ which pylint |
| 46 | + /usr/local/bin/pylint |
| 47 | +
|
| 48 | +The output given is the location of your checker, change the value of `TM_PYCHECKER` in preferences to the complete path and run the command again. |
| 49 | +EOF |
| 50 | +
|
| 51 | +html_footer</string> |
| 52 | + <key>input</key> |
| 53 | + <string>none</string> |
| 54 | + <key>inputFormat</key> |
| 55 | + <string>text</string> |
| 56 | + <key>name</key> |
| 57 | + <string>Help</string> |
| 58 | + <key>outputCaret</key> |
| 59 | + <string>afterOutput</string> |
| 60 | + <key>outputFormat</key> |
| 61 | + <string>html</string> |
| 62 | + <key>outputLocation</key> |
| 63 | + <string>newWindow</string> |
| 64 | + <key>scope</key> |
| 65 | + <string>source.python</string> |
| 66 | + <key>uuid</key> |
| 67 | + <string>7D408009-B629-4DB7-84E4-EA8EAF24FDA9</string> |
| 68 | + <key>version</key> |
| 69 | + <integer>2</integer> |
| 70 | +</dict> |
| 71 | +</plist> |
0 commit comments