Replace dict calls for literals (#4784)

* Replace dict calls for literals

* Pin flake8-comprehensions version to 3.3.0
This commit is contained in:
Tomás Farías Santana
2020-10-25 19:51:22 +02:00
committed by GitHub
parent 831e85682e
commit f8ba5daae2
6 changed files with 14 additions and 8 deletions
+6 -3
View File
@@ -31,9 +31,12 @@ class Tqdm(tqdm):
BAR_FMT_NOTOTAL = (
"{desc}{bar:b}|{postfix[info]}{n_fmt} [{elapsed}, {rate_fmt:>11}]"
)
BYTES_DEFAULTS = dict(
unit="B", unit_scale=True, unit_divisor=1024, miniters=1
)
BYTES_DEFAULTS = {
"unit": "B",
"unit_scale": True,
"unit_divisor": 1024,
"miniters": 1,
}
def __init__(
self,
+1 -1
View File
@@ -114,7 +114,7 @@ class Repo:
self.dvc_dir = None
self.tmp_dir = None
tree_kwargs = dict(use_dvcignore=True, dvcignore_root=self.root_dir)
tree_kwargs = {"use_dvcignore": True, "dvcignore_root": self.root_dir}
if scm:
self.tree = scm.get_tree(rev, **tree_kwargs)
else:
+4 -1
View File
@@ -64,7 +64,10 @@ class S3Tree(BaseTree):
def s3(self):
import boto3
session_opts = dict(profile_name=self.profile, region_name=self.region)
session_opts = {
"profile_name": self.profile,
"region_name": self.region,
}
if self.access_key_id:
session_opts["aws_access_key_id"] = self.access_key_id
+1 -1
View File
@@ -132,7 +132,7 @@ tests_requirements = [
"rangehttpserver==1.2.0",
"beautifulsoup4==4.4.0",
"flake8-bugbear",
"flake8-comprehensions",
"flake8-comprehensions==3.3.0",
"flake8-string-format",
"pylint==2.5.3",
"pylint-pytest>=0.3.0",
+1 -1
View File
@@ -271,6 +271,6 @@ def test_walk_dont_ignore_subrepos(tmp_dir, scm, dvc):
assert get_dirs(next(dvc_tree.walk(path))) == []
assert get_dirs(next(scm_tree.walk(path))) == []
kw = dict(ignore_subrepos=False)
kw = {"ignore_subrepos": False}
assert get_dirs(next(dvc_tree.walk(path, **kw))) == ["subdir"]
assert get_dirs(next(scm_tree.walk(path, **kw))) == ["subdir"]
+1 -1
View File
@@ -13,7 +13,7 @@ from dvc.command.diff import _digest, _show_md
"checksum, expected",
[
("wxyz1234pq", "wxyz1234"),
(dict(old="1234567890", new="0987654321"), "12345678..09876543"),
({"old": "1234567890", "new": "0987654321"}, "12345678..09876543"),
],
ids=["str", "dict"],
)