diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2021-12-21 02:50:05 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2021-12-21 02:50:05 +0100 |
| commit | 56b2ab072e099283d256c8346ae67f4dae77e260 (patch) | |
| tree | cacbda0d76e1b0440aee524761ef2684b387efab /src_doit/__init__.py | |
| parent | 3aa527764f9198335e3748a023f9135faec3a619 (diff) | |
WIP c implementation
Diffstat (limited to 'src_doit/__init__.py')
| -rw-r--r-- | src_doit/__init__.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src_doit/__init__.py b/src_doit/__init__.py index f1d9a2f..89ba32c 100644 --- a/src_doit/__init__.py +++ b/src_doit/__init__.py @@ -1,5 +1,6 @@ from pathlib import Path import subprocess +import sys import tempfile from hat import json @@ -19,6 +20,7 @@ __all__ = ['task_clean_all', 'task_test', 'task_ui', 'task_deps', + 'task_format', 'task_json_schema_repo', *dist.__all__] @@ -104,7 +106,18 @@ def task_ui(): def task_deps(): """Install dependencies""" - return {'actions': ['yarn install --silent']} + return {'actions': ['yarn install --silent', + f'{sys.executable} -m peru sync']} + + +def task_format(): + """Format""" + files = [*Path('src_c').rglob('*.c'), + *Path('src_c').rglob('*.h')] + for f in files: + yield {'name': str(f), + 'actions': [f'clang-format -style=file -i {f}'], + 'file_dep': [f]} def task_json_schema_repo(): |
