Commit Graph

30 Commits

Author SHA1 Message Date
Ross Bayer
bb4e5fe86b [Python: flake8] Appease the utils/python_lint.py script. 2020-01-17 01:03:20 -08:00
John McCall
17cc65cc38 Patch Sphinx to tell it about the Swift lexers in a somewhat simpler way. 2019-11-05 17:45:37 -05:00
Daniel Jalkut
56b314f741 Fix documentation build (#9980)
* Fix a documentation build failure caused by missing _ underscore in footnote citation.

* Get archive/LangRef.html building again. I'm not sure this is the most desirable way to address the failure to locate archive/LangRef.html but I confirmed this causes the desired _build/html/archive/LangRef.html to be created when making docs.
2017-05-30 10:50:03 -07:00
Jordan Rose
ca14c36936 [docs] Fix syntax highlighting issues to support newer Sphinxes. (#4283)
- Update the Pygments lexer we use for parsing Swift-like code.
- State more explicitly which highlighting should be used in which
  code blocks.
- Disable highlighting altogether in certain cases (such as SIL.rst,
  which has equal amounts grammar and SIL excerpts).

This should fix the warnings-as-error issues coming from Sphinx > 1.3.4.

Based on a patch by Jeremy Fergason!

https://bugs.swift.org/browse/SR-620
2016-08-12 22:59:11 -07:00
Jordan Rose
2e6874d4d1 [sphinx] Update conf.py for Python 3 compatibility (SR-1763). (#3086)
Patch by Gwynne Raskind.

https://bugs.swift.org/browse/SR-1763
2016-06-20 12:51:33 -07:00
practicalswift
1edb62dc38 [Python] Make flake8 linting pass without errors/warning (w/ default rules) 2016-03-13 20:19:51 +01:00
practicalswift
d5326bfdc4 [Python] Replace global linting excludes with local line-level excludes ("noqa")
Replace the project global linting rule excludes (as defined in .pep8) with
fine-grained "# noqa" annotations.

By using noqa annotation the excludes are made on a per line basis instead of
globally.

These annotations are used where we make deliberate deviations from the standard
linting rules.

To lint the Python code in the project:

  $ flake8

To install flake8:

  $ pip install flake8

See https://flake8.readthedocs.org/en/latest/ for details.

To enable checking of the PEP-8 naming conventions, install the optional
extension pep8-naming:

  $ pip install pep8-naming

To enable checking of blind "except:" statements, install the optional
extension flake8-blind-except:

  $ pip install flake8-blind-except

To enable checking of import statement order, install the optional
extension flake8-import-order:

  $ pip install flake8-import-order
2016-03-10 16:22:48 +01:00
practicalswift
0796eaad1f [Python] Fix 80-column violations 2016-03-09 23:52:11 +01:00
Brian Gesiak
c9000af795 Merge pull request #1526 from practicalswift/fix-pep8-violations-ii
[Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
2016-03-08 23:55:46 -05:00
practicalswift
265835fdfc [Python] Use consistent import ordering for Python code
Ordering used:
1.) standard library imports
2.) third party imports
3.) local package imports

Each group is individually alphabetized.
2016-03-07 23:25:16 +01:00
practicalswift
183da818df [Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
* E101: indentation contains mixed spaces and tabs
* E111: indentation is not a multiple of four
* E128: continuation line under-indented for visual indent
* E302: expected 2 blank lines, found 1
* W191: indentation contains tabs
2016-03-07 22:36:23 +01:00
practicalswift
04afd6e640 [Python] Improve consistency: "block comment should start with '# '" (PEP-8) 2016-03-05 14:03:16 +01:00
Jordan Rose
9c37cb6a7b [Sphinx] Fix the copyright year to always be the current year.
This is what we were doing manually anyway.
2016-02-12 18:43:15 -08:00
practicalswift
33452564f6 PEP8: Fix violations of type "continuation line under-indented for hanging indent" (E121) 2016-01-24 09:47:53 +01:00
practicalswift
1cd4d4e9c9 [gardening] Fix violations of non-controversial PEP8 rules
Fixes:
* multiple statements on one line (colon) (E701)
* missing whitespace around arithmetic operator (E226)
* missing whitespace around operator (E225)
* closing bracket does not match visual indentation (E124)
* blank line contains whitespace (W293)
* continuation line missing indentation or outdented (E122)
* continuation line over-indented for hanging indent (E126)
* missing expected blank line (E301)
* trailing whitespace (W291)
* unexpected spaces around keyword / parameter equals (E251)
* whitespace after '(', '[' or '{' (E201)
* whitespace before ')', ']' or '}' (E202)
* whitespace before ',' or ':' (E203)
2016-01-23 09:23:33 +01:00
Dmitri Gribenko
3cf4dd36a1 Update language version to 3.0 2016-01-19 19:59:05 -07:00
practicalswift
cd337dc83b Remove unused imports. 2015-12-21 10:24:08 +01:00
Justas Brazauskas
7b941a6e9e Fixed typos in ./docs 2015-12-10 10:11:21 +02:00
Ted Kremenek
4c12a1278a Bump Swift version to '2.2'. 2015-11-17 22:19:33 -08:00
Jordan Rose
de15f8a3b5 [docs] Move several historical-interest-only docs to an archive/ subfolder. 2015-11-05 08:52:51 -08:00
Slava Pestov
fc1e8482c1 Copyright year
Swift SVN r31966
2015-09-15 18:58:54 +00:00
Ted Kremenek
8741999517 Update Swift version for docs to 2.1
Swift SVN r31853
2015-09-10 06:41:30 +00:00
Slava Pestov
977a0876f2 Documentation pages still had "Swift 1.0" in the title
Swift SVN r31688
2015-09-04 02:08:56 +00:00
Dave Abrahams
8c04ba6166 Docs: switch links to a subtler color
Red hurts text readability when it occurs inline

Swift SVN r25303
2015-02-15 22:51:39 +00:00
Dave Abrahams
cb8397a2c6 Docs: Default to highlighting code as Swift
Swift SVN r25301
2015-02-15 22:51:37 +00:00
Jordan Rose
0606251fc4 [docs] Use the same theme as our internal docs.
In particular, this uses normal HTML bullets instead of images so that
rich text copy/paste works correctly.

Swift SVN r23376
2014-11-17 19:42:00 +00:00
Jordan Rose
a526eaea4f [docs] Bump copyright.
Swift SVN r18967
2014-06-18 00:03:27 +00:00
Ted Kremenek
4a211bcb9a Change docs version to "1.0" to match "Swift 1.0". Copyright is also to Apple.
Swift SVN r6934
2013-08-06 06:08:54 +00:00
Dave Abrahams
05eeba93f4 Turn on ReST error checking in CMake documentation builds
(it was already on in Makefile builds)

Also, fix the ReST errors it found.

Also, monkeypatch pygments so it can see our lexers when we build
documentation.  This keeps all doc builds from producing heaps of
warnings.

Swift SVN r6023
2013-07-05 22:33:50 +00:00
Daniel Dunbar
1eeecdd874 Change Swift docs to use Sphinx.
- I've converted every document except the LangRef, which is more trouble to
   convert because of the use of styling to embed notes.
 - 'make html' with sphinx-build in your path to build the docs.

Now back to my regularly scheduled breaking things. :)

Swift SVN r2410
2012-07-23 18:50:00 +00:00