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

Formate uploading files with black linting tool #1094

Merged
merged 11 commits into from
May 9, 2024

Conversation

similato87
Copy link
Collaborator

Overview

This PR aims to address Issue #1023 by integrating code formatting and linting tools into our development workflow. The primary goal is to enhance efficiency and improve the quality of the suggestions provided by LLMs by pre-screening code for errors. This preemptive check reduces the computational demand on LLMs, allowing them to focus on the complexity of tasks rather than basic syntax corrections.

Implementation Details

To minimize the impact on user experience, we plan to implement an automatic linting feature that will be enabled by default during the code processing phase. Users will be informed that their codebase has undergone linting, ensuring transparency. Additionally, we will provide an option for users who prefer not to use the linting tools, respecting diverse development preferences.

Scope and Targets

The initial rollout will focus on supporting Python files. This decision is made to strike a balance between managing dependencies and meeting the feature's requirements efficiently. By starting with these languages, we aim to cover a significant portion of the development activities within our community while keeping the implementation manageable.

@similato87 similato87 marked this pull request as ready for review May 2, 2024 17:12
@viborc viborc requested review from DannyFranklin and removed request for DannyFranklin May 9, 2024 16:32
@viborc viborc merged commit b559317 into main May 9, 2024
4 checks passed
@ATheorell
Copy link
Collaborator

I have a extra request :)

I think it would make sense to always run linting by default inside FileStore:push and also run it by default inside FileStore:pull, but in this case, make an optional argument to disable linting

@similato87
Copy link
Collaborator Author

I have a extra request :)

I think it would make sense to always run linting by default inside FileStore:push and also run it by default inside FileStore:pull, but in this case, make an optional argument to disable linting

I support this suggestion as it aligns with best practices for software development. I'm planning to refactor this section in my upcoming PR. Would it be advisable to introduce a return flag at this point in the code? main.pyL456. I'm considering modifying the function to return files_dict_before and isLinting like so: files_dict_before, isLinting = FileSelector(project_path).ask_for_files(). Additionally, should I initialize a FileStore in the main function to handle both pull and push operations, utilizing the isLinting flag to toggle the linting status?

@ATheorell
Copy link
Collaborator

should I initialize a FileStore in the main function to handle both pull and push operations, utilizing the isLinting flag to toggle the linting status?

Yes, that sounds great! Actually, such a FileStore object is already initialized in the main at line 453 and could be used for all io-operations. Inside the FileSelector, it would then make sense to use the isLinting variable to toggle whether the FileStore object should lint or not for the case of reading files for improve.

@similato87 similato87 deleted the 1023-ruff-linting-for-python-code branch May 11, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants