Commit graph

38 commits

Author SHA1 Message Date
Noorhteen Raja NJ
fb6b9109ed
docs: update for release activity (#4754) 2022-04-14 14:51:02 +02:00
Oliver Bestwalter
5268dd8003
use recommended pytest entry point in docs and comments (#4671)
Since pytest 3.0 (2016) - the recommended commandline invocation is pytest (without the dot).

py.test is still available for backwards compatibility but might be removed at some point in the future and the new entry point is already well established.
2022-02-19 01:45:45 +05:30
Noorhteen Raja NJ
9fbecfc155
feat: use github actions to deploy docs (#4641)
* feat: use github actions to deploy docs

fixes #4473

* fix: install xonsh

* fix: doc action

* chore: support *.md for documentation

* fix: remove hardcoded docs link

it affects local testing

* refactor: move sphinx extensions to its own package

* fix: remove deprecated get_theme_dir

As of Sphinx 1.2, this is passed to Sphinx via a ``setup.py`` entry
point,
and no longer needs to be included in your documentation's
``conf.py``.

* feat: jinja2 render without affecting incremental build

* style:

* feat: auto generate API doc

no need to create a file for each module

* chore: watch top-level and nested files

* refactor: update lib api-docs as well

* fix: import errors when doc generated

for some modules

* fix: relative path

* feat: add release handling

* Update .github/workflows/docs.yml

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>

* refactor: use github-app-token

* chore: deploy docs only when merged

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2022-01-18 11:38:27 -05:00
Noorhteen Raja NJ
7c4e207abd
update test xsh usage (#4581)
* todo

* test: remove usage of DummyEnv and setting .env attribute on xession fixture

one step closer to making too much of tweaking to xession during tests

* test: fix tests vox and gitstatus-prompt

* docs: update test-fixture usage

* fix: import flake8 error

* test: remove direct access to XSH in tests

* test: remove usage of XSH in test files

* todo

* test: use tmp-dir to create stubs

* refactor: use fixture factory to mock out XonshSession

* refactor: remove direct access of XSH from functions

* refactor: remove direct access of XSH from functions

* fix: qa checks

* refactor: rename variables to match their values

* test: update failing tests because it had no PATH set previously

* fix: remove builtins usage from pyghooks.py

* style:

* refactor: update tests to use fixtures

* fix: env varialbe is setup per function

some tests accidentally update the env variables and that is leaking
into next tests

* fix: failing vox tests

* test: set commands_cache per test

* test: fix failing tests

* fix: failing tests on linux

ptk-highlight

* fix: failing tests on Windows

cwd-prompt

* test: copy env as to not affect original object

* fix: lazily evaluate cmds-cache in pyghooks

* test: fix failing tests

* fix: qa errors import

* test: set commands-cache per test

while caching path results

* test: speedup test_thread_local_swap

* fix: failing tests on windows

* refactor: Execer doesn't control session

* refactor: XSH.unload will take care of reversing builtins attrs set

* test: use env.update over monkeypatch

* Revert "test: use env.update over monkeypatch"

This reverts commit 010a5022247a098f1741966b8af1bf758663480e.
2022-01-07 17:33:22 -05:00
Noorhteen Raja NJ
35d44068d3
Update CONTRIBUTING.rst (#4616)
* Update CONTRIBUTING.rst

* Update CONTRIBUTING.rst
2021-12-25 19:12:07 +05:30
Vasilis Gerakaris
b13298f3cd
docs: update header image link for Contributing.md (#4527) 2021-11-17 13:57:07 -05:00
Evgeny
3df1426f8e
Updated references to point to 'main' instead of 'master' (#4202)
* doc: update path to the most recent xonsh source code ('master' to 'main')

* doc: change 'master' to 'main' in some doc references
2021-03-30 13:40:43 -04:00
Daniel Shimon
224fc55e41
Completion context (#4017)
* completion-context: Add CompletionContextParser placeholder

Implements the xonsh (tab-)completion context parser.
This parser is meant to parse a (possibly incomplete) command line.

* completers: tools: Implement ``contextual_completer`` decorator

This is used to mark completers that want to use the parsed completion context.

* completers: Enable using contextual completers in xonsh/completer.py

* completers: readline, ptk, jupyter: Enable using contextual completers

Pass ``multiline_text`` and ``cursor_index`` to ``Completer.complete()``

* parsers: base: Refactor out a ``raise_parse_error`` function

* tokenize: Enable ``tolerant`` mode

If ``tolerant`` is True, yield ERRORTOKEN instead of
    throwing an exception when encountering an error.

* lexer: Enable ``tolerant`` mode

Tokenize without extra checks (e.g. paren matching).
When True, ERRORTOKEN contains the erroneous string instead of an error msg.

* tests: lexer: Test ``tolerant`` mode

* completion-context: Implement simple CommandContext parsing

* completion-context: tests: Test simple CommandContext parsing

* completion-context: Implement parsing sub-commands

* completion-context: tests: Test parsing sub-commands

* completion-context: Add news file

* completion-context: parser: Add parser table path to relevant locations

Code-coverage, mypy ignore list, etc.

* completion-context: Implement parsing partial strings and line continuations

* completion-context: tests: Test parsing partial strings and line continuations

* completion-context: Convert ``Span`` object to a ``slice``

* completion-context: Refactor out ``create_command`` and ``cursor_in_span``

* completion-context: Implement handling empty commands

* completion-context: tests: Test handling empty commands

* completion-context: Implement handling multiple commands

Separated by newlines, `;`, `and`, `or`, `|`, `&&`, `||`

* completion-context: tests: Test handling multiple commands

Separated by newlines, `;`, `and`, `or`, `|`, `&&`, `||`

* completion-context: Implement handling python context

* completion-context: tests: Test handling python context

* completers: tools: Add `contextual_command_completer`

* completers: Make `complete_skipper` contextual

* completers: Make `complete_from_man` contextual

* completers: Make `complete_from_bash` contextual and add test

* completers: Make `complete_pip` contextual and update tests

* completers: Keep opening string quote if it exists

* completion-context: Handle cursor after a closing quote

For example - cursor at the end of ``ls "/usr/"``.
1. The closing quote will be appended to all completions.
 I.e the completion ``/usr/bin`` will turn into ``/usr/bin"``
2. If not specified, lprefix will cover the closing prefix.
 I.e for ``ls "/usr/"``, the default lprefix will be 6 to include the closing quote.

* completion-context: tests: Test handling cursor after a closing quote

* completion-context: Fix bug with multiple empty commands

e.g. `;;;`

* completion-context: tests: Speed up tests

From ~15 seconds to ~500 ms

* completion-context: Expand commands and subcommands

* completion-context: Simplify `commands` rules

* completion-context: Simplify `sub_expression` rules

* completion-context: Simplify editing a multi-command token

* completion-context: Inline `create_command`

* completion-context: Implement `contextual_command_completer_for` helper

* completers: Make `complete_cd`/`complete_rmdir` contextual and add tests

* completers: path: Don't append a double-backslash in a raw string

When completing a path, if a raw string is used (e.g. `r"C:\Windows\"`),
there's no reason to append a double-backslash (e.g. `r"C:\Windows\\"`).

* completers: Make `complete_xonfig`/`complete_xontrib` contextual and add tests

* completers: Make `complete_completer` contextual and add tests

* completers: Make `complete_import` contextual and add tests

* completion-context: Add python `ctx` attribute

* completion: tools: Simplify `RichCompletion` attributes handling

* completers: Make `base`, `python`, and `commands` contextual

* Add tests
* No need for `python_mode` completer anymore

* completion: tools: Add `append_space` attribute to `RichCompletion`

* completion-context: Get all lines in a main python context

* xontrib: jedi: Make the `jedi` completer contextual

* completers: tools: Remove `get_ptk_completer` and `PromptToolkitCompleter.current_document`

These aren't needed anymore now that contextual completers can access the multiline code (via `PythonContext.multiline_code`).

* completion-context: ptk: Expand aliases

* completion-context: jupyter: Expand aliases and fix line handling

* completer: Preserve custom prefix after closing quote

* completers: bash: Ensure bash completion uses the complete prefix

* completers: pip: Append a space after a pip command

* completers: pip: Prevent bad package name completions

* completers: Remove a common prefix from `RichCompletion` if `display` wasn't provided

* completion-context: Treat cursor at edge of `&& || | ;` as normal args

This will be used for completing a space

* completers: Complete end proc keywords correctly
2021-03-30 13:37:56 -04:00
Danny Sepler
b59b0ceed2 Fix some typos 2020-10-03 23:02:39 -04:00
Bob Hyman
224c555afe Document preference for pip install over setup.py. 2020-08-11 12:25:17 -04:00
Bob Hyman
a6bb5e2d56 Run (pure) flake8 in CI; deprecate config for pytest-flake8 2020-05-06 22:49:11 -04:00
Noortheen Raja
419c854eea update docs - running pylint for specific files 2020-03-15 20:43:56 +05:30
Anthony Scopatz
88d239d976 black not available on 3.5 2019-07-19 17:30:34 -04:00
Sean Farley
ec3d2ca8ad git: add pre-commit dependency
This also adds documentation for how to install this git pre-commit hook
which will run black before committing. The only downside to doing that
is the, perhaps confusing, initial run which will clone the black
repository before a dev's first commit.

Running on the command-line will be quite obvsious since the default
output shows what pre-commit is doing. But running in a gui or
editor (e.g. magit) will hide that. Viewer discretion is advised.
2019-07-13 15:44:23 -05:00
Sean Farley
b570b50836 python: add black to test dependencies
This adds black to the contributing guide as well.
2019-07-13 15:44:23 -05:00
Alexander Steffen
fa2594318d Update style guide to match reality
* black likes double quotes instead of single quotes.
* Python 3.4 is not a target anymore.
2019-07-13 10:44:55 +02:00
virus
7ab2e9113c replace link of numpydoc's styleguide to new one 2019-03-14 00:03:59 +09:00
virus
d9c7360dea Change link format of numpydoc (as dependencies)
This commit fixes these warnings.

```
src/xonsh/docs/devguide.rst:430: WARNING: Duplicate explicit target name: "numpydoc".
src/xonsh/docs/devguide.rst:107: WARNING: Duplicate target name, cannot be used as a unique reference: "numpydoc".
src/xonsh/docs/devguide.rst:263: WARNING: Duplicate target name, cannot be used as a unique reference: "numpydoc".
```
2019-03-14 00:03:59 +09:00
halloleo
4eb8b4818d How to run xonsh in Emacs
* FAQ section about how to run xonsh in Emacs
* Updated the requirements for compiling the documentation
2018-11-06 18:42:59 +11:00
David Dotson
1d60f9397b Updated docs with __xonsh__ changes 2018-09-30 13:59:08 -07:00
Joel Gerber
12e2fb80cc
Documentation spelling corrections
A number of common spelling typos found within various restructuredText
files have been identified and resolved.
2017-06-07 11:51:06 -04:00
laerus
864ee3f57a devguide update 2016-10-01 09:49:21 +03:00
Gil Forsyth
e363192d67 remove bash (from the docs)
swapping out all instances of `bash` code-blocks for `console`
code-blocks for better syntax highlighting
2016-08-18 14:18:57 -04:00
SanketDG
c96383ad0f devguide.rst: Add proper spacing in command 2016-08-18 21:35:33 +05:30
Leonardo Santagada
f1a41f2b1c reformat paragraph and remove trailing whitespace 2016-07-22 11:47:36 +02:00
Justin Moen
ec185983c3 Improve first set of dev instructions 2016-07-16 23:20:35 -07:00
laerus
6bdadba71e nop 2016-07-03 22:05:49 +03:00
laerus
31c5760182 'typoz' 2016-07-03 12:26:52 +03:00
laerus
da13f310f5 'info about writing the tests' 2016-07-03 11:43:22 +03:00
Paul Goelz
49be0a26cf Add missing -r flag to pip install command in developer's guide 2016-06-28 23:54:37 +02:00
Gil Forsyth
6d489843c3 update CONTRIBUTING with changes to pytest 2016-06-23 17:11:45 -04:00
Anthony Scopatz
d14292cb9c some doc fixes 2016-06-18 17:32:37 -04:00
Anthony Scopatz
5fd1d4f4a8 tracer and docs 2016-06-16 20:58:53 -04:00
Anthony Scopatz
1d7875e1ba Some cl instructions in contributing 2016-06-11 17:49:00 -04:00
Jeremy Donahue
a775b287db Update docker script reference to reflect its new name
docker.py was renamed to xonsh-in-docker.py, update the docs to reflect it.
2016-06-08 18:46:48 -07:00
Rahiel Kasim
10e31c9d06 CONTRIBUTING: render as RST on GitHub 2016-06-05 23:04:44 +02:00
Anthony Scopatz
5facb9bdda cont mv 2015-03-28 12:25:02 -05:00
Anthony Scopatz
e8e54f4de7 CONTRIBUTING.rst 2015-03-28 12:24:25 -05:00