Skip to content

Commit

Permalink
Merge pull request xonsh#3983 from jnoortheen/upgrade-black-20.8b1
Browse files Browse the repository at this point in the history
Upgrade black 20.8b1
  • Loading branch information
scopatz authored Nov 25, 2020
2 parents d8115ec + ba08311 commit 24862e0
Show file tree
Hide file tree
Showing 17 changed files with 352 additions and 264 deletions.
23 changes: 23 additions & 0 deletions news/use-black-20.8.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* upgrade black formatter to version 20.8b1

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
2 changes: 1 addition & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ prompt-toolkit>=3.0
pygments>=2.2
codecov
coverage
black==19.10b0 --pre
black==20.8b1 --pre
pre-commit
mypy==0.790
4 changes: 2 additions & 2 deletions xonsh/commands_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def is_empty(self):
@staticmethod
def get_possible_names(name):
"""Generates the possible `PATHEXT` extension variants of a given executable
name on Windows as a list, conserving the ordering in `PATHEXT`.
Returns a list as `name` being the only item in it on other platforms."""
name on Windows as a list, conserving the ordering in `PATHEXT`.
Returns a list as `name` being the only item in it on other platforms."""
if ON_WINDOWS:
pathext = builtins.__xonsh__.env.get("PATHEXT", [])
name = name.upper()
Expand Down
2 changes: 1 addition & 1 deletion xonsh/completers/bash_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _get_bash_completions_source(paths=None):


def _bash_get_sep():
""" Returns the appropriate filepath separator char depending on OS and
"""Returns the appropriate filepath separator char depending on OS and
xonsh options set
"""
if platform.system() == "Windows":
Expand Down
3 changes: 1 addition & 2 deletions xonsh/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ def print_one_job(num, outfile=sys.stdout):


def get_next_job_number():
"""Get the lowest available unique job number (for the next job created).
"""
"""Get the lowest available unique job number (for the next job created)."""
_clear_dead_jobs()
i = 1
while i in builtins.__xonsh__.all_jobs:
Expand Down
2 changes: 1 addition & 1 deletion xonsh/lib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __new__(cls):


class ChainDB(ChainMap):
""" A ChainMap who's ``_getitem__`` returns either a ChainDB or
"""A ChainMap who's ``_getitem__`` returns either a ChainDB or
the result. The results resolve to the outermost mapping."""

def __getitem__(self, key):
Expand Down
44 changes: 22 additions & 22 deletions xonsh/lib/itertools.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
def as_iterable(iterable_or_scalar):
"""Utility for converting an object to an iterable.
Parameters
----------
iterable_or_scalar : anything
Parameters
----------
iterable_or_scalar : anything
Returns
-------
l : iterable
If `obj` was None, return the empty tuple.
If `obj` was not iterable returns a 1-tuple containing `obj`.
Otherwise return `obj`
Returns
-------
l : iterable
If `obj` was None, return the empty tuple.
If `obj` was not iterable returns a 1-tuple containing `obj`.
Otherwise return `obj`
Notes
-----
Although string types are iterable in Python, we are treating them as not iterable in this
method. Thus, as_iterable(string) returns (string, )
Notes
-----
Although string types are iterable in Python, we are treating them as not iterable in this
method. Thus, as_iterable(string) returns (string, )
Examples
---------
>>> as_iterable(1)
(1,)
>>> as_iterable([1, 2, 3])
[1, 2, 3]
>>> as_iterable("my string")
("my string", )
"""
Examples
---------
>>> as_iterable(1)
(1,)
>>> as_iterable([1, 2, 3])
[1, 2, 3]
>>> as_iterable("my string")
("my string", )
"""

if iterable_or_scalar is None:
return ()
Expand Down
Loading

0 comments on commit 24862e0

Please sign in to comment.