Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Nov 4, 2024
1 parent 3a6dcdd commit 4db48cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/aind_data_schema_models/_generators/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import subprocess


def generate_code(data_type: str,
root_path: str,
isort: bool = True,
black: bool = True):
def generate_code(data_type: str, root_path: str, isort: bool = True, black: bool = True):
"""Generate code from the template type
Parameters
Expand Down Expand Up @@ -59,7 +56,12 @@ def generate_code(data_type: str,
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate code from templates.")
parser.add_argument("--type", required=True, help="The data type to generate code for (e.g., 'platforms').")
parser.add_argument("--root-path", required=False, default="./src/aind_data_schema_models/", help="Path to the source folder of the project")
parser.add_argument(
"--root-path",
required=False,
default="./src/aind_data_schema_models/",
help="Path to the source folder of the project",
)
args = parser.parse_args()

generate_code(args.type, args.root_path)
2 changes: 2 additions & 0 deletions tests/test_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test generator class"""

import unittest
from unittest.mock import patch, mock_open, MagicMock
from pathlib import Path
Expand All @@ -13,6 +14,7 @@

class TestGenerateCode(unittest.TestCase):
"""Test generate_code"""

@patch("builtins.open", new_callable=mock_open, read_data="template content")
@patch("pandas.read_csv")
@patch("subprocess.run")
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils testing"""

import unittest
from aind_data_schema_models import utils # Assuming the functions are defined in a module named utils

Expand Down

0 comments on commit 4db48cc

Please sign in to comment.