Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] All Phase 1 Components (Agents, Blocks, Tools) are PEP8 Adherent (Code Styling) #19

Open
og-hayden opened this issue Jan 10, 2025 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@og-hayden
Copy link
Collaborator

Problem Statement

The code in legion/agents, legion/interface, and legion/blocks should adhere to PEP8 styling for visual consistency and code quality.

Proposed Solution

In scripts/lint.py, there is a script that uses flake8 to find code styling errors, and ruff to try to automatically fix them. This can be slightly reworked to find/auto-resolve/output remaining issues for specific directories.

Alternative Solutions

Additional Context

Implementation Ideas

Benefits

Improved developer experience, specifically those helping to maintain the codebase.

Potential Challenges

Code styling is kind of boring, but important.

@og-hayden og-hayden added enhancement New feature or request good first issue Good for newcomers labels Jan 10, 2025
@anandan947
Copy link
Contributor

anandan947 commented Jan 15, 2025

I am happy to work on this.

Couple of clarifications -

There are a bunch of style issues of the following type -

D401 First line of docstring should be in imperative mood: "Helper function to create annotated parameter types with descriptions"

Should these types of issues be ignored? There are a lot of docstrings in the the codebase that does not follow this and IMO, they look fine. Changing them manually one by one into imperative mood will be a lot of work with only few upsides. Does it make sense to add this to the ignored list of linting issues?

Also, the contributing.md file says the line length for code is meant to be 79 characters. However, the ruff setting is set to 100 for max code length. Could you confirm which one it is?

@og-hayden
Copy link
Collaborator Author

I'll be reducing the linting ruleset, as right now they seems a bit 'too picky' for no good reason. I just used some defaults I foud online. I'll DM you on Discord with updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants