Skip to content

Commit 9ccdfaa

Browse files
authored
Merge pull request #82 from AgentOps-AI/use-ruff
add ruff and ruff format project
2 parents 52caa3b + e86f55b commit 9ccdfaa

File tree

20 files changed

+611
-359
lines changed

20 files changed

+611
-359
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,16 @@ Adding tools is easy once you understand the project structure. A few things nee
3535
- The tools that are exported from this file should be listed in the tool's config json.
3636
4. Manually test your tool integration by running `agentstack tools add <your_tool>` and ensure it behaves as expected.
3737

38+
## Before creating your PR
39+
Be sure that you are opening a PR using a branch other than `main` on your fork. This enables us
40+
to pull your branch and make modifications to the PR with your permission that may be helpful.
41+
42+
### Formatting
43+
AgentStack uses Ruff formatter for consistent code formatting. To format your code, run:
44+
```bash
45+
pip install ruff
46+
ruff format .
47+
```
48+
3849
## Tests
3950
HAHAHAHAHAHAHA good one

agentstack/cli/agentstack_data.py

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@
77

88

99
class ProjectMetadata:
10-
def __init__(self,
11-
project_name: str = None,
12-
project_slug: str = None,
13-
description: str = "",
14-
author_name: str = "",
15-
version: str = "",
16-
license: str = "",
17-
year: int = datetime.now().year,
18-
template: str = "none",
19-
template_version: str = "0",
20-
):
10+
def __init__(
11+
self,
12+
project_name: str = None,
13+
project_slug: str = None,
14+
description: str = "",
15+
author_name: str = "",
16+
version: str = "",
17+
license: str = "",
18+
year: int = datetime.now().year,
19+
template: str = "none",
20+
template_version: str = "0",
21+
):
2122
self.project_name = clean_input(project_name) if project_name else "myagent"
22-
self.project_slug = clean_input(project_slug) if project_slug else self.project_name
23+
self.project_slug = (
24+
clean_input(project_slug) if project_slug else self.project_name
25+
)
2326
self.description = description
2427
self.author_name = author_name
2528
self.version = version
@@ -76,10 +79,11 @@ def to_json(self):
7679

7780

7881
class FrameworkData:
79-
def __init__(self,
80-
# name: Optional[Literal["crewai"]] = None
81-
name: str = None # TODO: better framework handling, Literal or Enum
82-
):
82+
def __init__(
83+
self,
84+
# name: Optional[Literal["crewai"]] = None
85+
name: str = None, # TODO: better framework handling, Literal or Enum
86+
):
8387
self.name = name
8488

8589
def to_dict(self):
@@ -92,12 +96,13 @@ def to_json(self):
9296

9397

9498
class CookiecutterData:
95-
def __init__(self,
96-
project_metadata: ProjectMetadata,
97-
structure: ProjectStructure,
98-
# framework: Literal["crewai"],
99-
framework: str,
100-
):
99+
def __init__(
100+
self,
101+
project_metadata: ProjectMetadata,
102+
structure: ProjectStructure,
103+
# framework: Literal["crewai"],
104+
framework: str,
105+
):
101106
self.project_metadata = project_metadata
102107
self.framework = framework
103108
self.structure = structure

0 commit comments

Comments
 (0)