Skip to content

Commit

Permalink
🚚 Get rid of some precommit warnings after refactoring (#5291)
Browse files Browse the repository at this point in the history
  • Loading branch information
rix0rrr authored Mar 21, 2024
1 parent af093f0 commit cf9334b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
2 changes: 1 addition & 1 deletion dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import sys
import platform

from doit.tools import CmdAction, LongRunning
from doit.tools import LongRunning

if os.getenv('GITHUB_ACTION') and platform.system() == 'Windows':
# Add MSYS2 to the path, so we can use commands like 'bash' and 'cp' and 'mv'.
Expand Down
37 changes: 0 additions & 37 deletions tests/test_snippets/snippet_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,6 @@ def rootdir():
return os.path.join(os.path.dirname(__file__), '..', '..')


def collect_adventures_snippets(path):
Hedy_snippets = []
files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and f.endswith('.yaml')]
for file in files:
lang = file.split(".")[0]
file = os.path.join(path, file)
yaml = YamlFile.for_file(file)
levels = yaml.get('levels')

for level, content in levels.items():
level_number = int(level)
if level_number > hedy.HEDY_MAX_LEVEL:
print('content above max level!')
else:
try:
number = 0
# commands.k.demo_code
for x, y in content.items():
if 'code' in y.keys() and 'debug' not in y.keys():
snippet = Snippet(
filename=file,
level=level_number if level_number > 0 else 1,
language=lang,
field_name=f'snippet {number}',
code=y['code'])
Hedy_snippets.append(snippet)
number += 1
except BaseException:
print(f'Problem reading commands yaml for {lang} level {level}')

return Hedy_snippets


def collect_adventures_snippets(path, filtered_language=None):
Hedy_snippets = []
files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and f.endswith('.yaml')]
Expand Down Expand Up @@ -135,10 +102,6 @@ def collect_cheatsheet_snippets(path):
try:
# commands.k.demo_code
for k, command in enumerate(yaml[level]):
command_text_short = \
command['name'] if 'name' in command.keys()\
else command['explanation'][0:10]

snippet = Snippet(
filename=file,
level=level,
Expand Down

0 comments on commit cf9334b

Please sign in to comment.