Skip to content

Commit 264f418

Browse files
authored
Merge pull request #12 from makermelissa/main
Updated so checks are passing
2 parents e4d4d65 + 5c71565 commit 264f418

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
repos:
66
- repo: https://github.com/python/black
7-
rev: 19.10b0
7+
rev: 21.6b0
88
hooks:
99
- id: black
1010
- repo: https://github.com/fsfe/reuse-tool
11-
rev: latest
11+
rev: v0.12.1
1212
hooks:
1313
- id: reuse
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v2.3.0
15+
rev: v4.0.1
1616
hooks:
1717
- id: check-yaml
1818
- id: end-of-file-fixer

adafruit_shell.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ def select_n(message, selections):
5555

5656
for index, selection in enumerate(selections):
5757
options.append(
58-
{"selector": str(index + 1), "prompt": selection, "return": index + 1,}
58+
{
59+
"selector": str(index + 1),
60+
"prompt": selection,
61+
"return": index + 1,
62+
}
5963
)
6064
return prompt.options(message, options)
6165

@@ -66,9 +70,11 @@ def run_command(self, cmd, suppress_message=False, return_output=False):
6670
original_stdout = sys.stdout
6771
original_stderr = sys.stderr
6872
try:
73+
# pylint: disable=consider-using-with
6974
proc = subprocess.Popen(
7075
cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
7176
)
77+
# pylint: enable=consider-using-with
7278
full_output = ""
7379
while True:
7480
output = proc.stdout.readline()
@@ -391,9 +397,8 @@ def write_text_file(self, path, content, append=True):
391397
content = "\n" + content
392398
else:
393399
mode = "w"
394-
service_file = open(self.path(path), mode)
395-
service_file.write(content)
396-
service_file.close()
400+
with open(self.path(path), mode) as service_file:
401+
service_file.write(content)
397402

398403
@staticmethod
399404
def is_python3():

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
# Author details
3535
author="Adafruit Industries",
3636
author_email="[email protected]",
37-
install_requires=["clint", "Adafruit-PlatformDetect",],
37+
install_requires=[
38+
"clint",
39+
"Adafruit-PlatformDetect",
40+
],
3841
# Choose your license
3942
license="MIT",
4043
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)