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

Set up black and pylint for Python #871

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

sweep-nightly[bot]
Copy link
Contributor

@sweep-nightly sweep-nightly bot commented Jul 30, 2023

Description

This PR sets up GitHub Actions workflows to enable black and pylint for Python in the repository. It checks if there are existing workflows for black and pylint and modifies them if they exist. If the workflows do not exist, it creates new workflows. The workflows are only triggered when the 'gha_enabled' PR is merged.

Summary of Changes

  • Modified .github/workflows/python_lint.yml to ensure black and pylint are correctly set up.
  • Added a condition to check if the 'gha_enabled' PR has been merged before running the workflow.
  • Created .github/workflows/python_lint.yml with the necessary steps to install the dependencies and run black and pylint on the Python files in the repository.
  • Added a condition to check if the 'gha_enabled' PR has been merged before running the workflow.

Fixes #768.

To checkout this PR branch, run the following command in your terminal:

git checkout sweep/add-gha-workflows

@sweep-nightly sweep-nightly bot added the sweep Assigns Sweep to an issue or pull request. label Jul 30, 2023
@vercel
Copy link

vercel bot commented Jul 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sweep-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2023 0:19am

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Jul 30, 2023

GitHub actions yielded the following error.

The command that failed is npx eslint .. Here are the relevant lines from the logs:

Oops! Something went wrong! :(

ESLint: 8.46.0

ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:

npm init @eslint/config

ESLint looked for configuration files in /home/runner/work/sweep/sweep/docs and its ancestors. If it found none, it then looked in your home directory.

If you think you already have a configuration file or if you need more help, please stop by the ESLint Discord server: https://eslint.org/chat

##[error]Process completed with exit code 2.

There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue.

This is likely a linting or type-checking issue with the source code but if you are updating the GitHub Actions or versioning, this could be an issue with the GitHub Action yaml files.

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Jul 30, 2023

GitHub actions yielded the following error.

The command that failed is npx eslint .. Here are the relevant lines from the logs:

/home/runner/work/sweep/sweep/docs/next.config.js
1:1  error  Parsing error: The keyword 'const' is reserved

✖ 1 problem (1 error, 0 warnings)

##[error]Process completed with exit code 1.

This is likely a linting or type-checking issue with the source code but if you are updating the GitHub Actions or versioning, this could be an issue with the GitHub Action yaml files.

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Jul 30, 2023

GitHub actions yielded the following error.

The command that failed is npx eslint .. Here are the relevant lines from the logs:

##[group]Run npx eslint .
�[36;1mnpx eslint .�[0m
shell: /usr/bin/bash -e {0}
##[endgroup]

/home/runner/work/sweep/sweep/docs/next.config.js
1:1  error  Parsing error: The keyword 'const' is reserved

✖ 1 problem (1 error, 0 warnings)

##[error]Process completed with exit code 1.

This is likely a linting or type-checking issue with the source code but if you are updating the GitHub Actions or versioning, this could be an issue with the GitHub Action yaml files.

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Jul 30, 2023

GitHub actions yielded the following error.

The command that failed is npx eslint .. Here are the relevant lines from the logs:

##[group]Run npx eslint .
�[36;1mnpx eslint .�[0m
shell: /usr/bin/bash -e {0}
##[endgroup]

/home/runner/work/sweep/sweep/docs/next.config.js
1:1  error  Parsing error: The keyword 'const' is reserved

✖ 1 problem (1 error, 0 warnings)

##[error]Process completed with exit code 1.

This is likely a linting or type-checking issue with the source code but if you are updating the GitHub Actions or versioning, this could be an issue with the GitHub Action yaml files.

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Jul 30, 2023

GitHub actions yielded the following error.

The command that failed is npx eslint .. Here are the relevant lines from the logs:

##[group]Run npx eslint .
�[36;1mnpx eslint .�[0m
shell: /usr/bin/bash -e {0}
##[endgroup]

/home/runner/work/sweep/sweep/docs/next.config.js
1:1  error  Parsing error: The keyword 'const' is reserved

✖ 1 problem (1 error, 0 warnings)

##[error]Process completed with exit code 1.

This is likely a linting or type-checking issue with the source code but if you are updating the GitHub Actions or versioning, this could be an issue with the GitHub Action yaml files.

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Jul 30, 2023

GitHub actions yielded the following error.

The command that failed is npx eslint .. Here are the relevant lines from the logs:

##[group]Run npx eslint .
�[36;1mnpx eslint .�[0m
shell: /usr/bin/bash -e {0}
##[endgroup]

/home/runner/work/sweep/sweep/docs/next.config.js
1:1  error  Parsing error: The keyword 'const' is reserved

✖ 1 problem (1 error, 0 warnings)

##[error]Process completed with exit code 1.

This is likely a linting or type-checking issue with the source code but if you are updating the GitHub Actions or versioning, this could be an issue with the GitHub Action yaml files.

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Jul 30, 2023

GitHub actions yielded the following error.

The command that failed is pip install black. Here are the relevant lines from the logs:

reformatted /home/runner/work/sweep/sweep/sweepai/handlers/on_ticket.py: Cannot parse: 408:12:             ,
reformatted /home/runner/work/sweep/sweep/sweepai/utils/utils.py

Oh no! 💥 💔 💥
43 files reformatted, 8 files left unchanged, 1 file failed to reformat.
##[error]Process completed with exit code 123.

This is likely a linting or type-checking issue with the source code but if you are updating the GitHub Actions or versioning, this could be an issue with the GitHub Action yaml files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep(slow): on enable GitHub actions, make Sweep tickets to set up linters using GHA
0 participants