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

Add black #31

Merged
merged 16 commits into from
Jun 25, 2024
Merged

Add black #31

merged 16 commits into from
Jun 25, 2024

Conversation

mdellabitta
Copy link
Contributor

@mdellabitta mdellabitta commented Jun 24, 2024

🚀 This description was created by Ellipsis for commit 6e9acec

Summary:

This PR introduces a consolidated linting workflow, updates dependencies, adds an author, configures Flake8, and includes refactoring in wikimedia modules.

Key points:

  • Add .github/workflows/lint.yml for Black, Flake8, and mypy linting on push and pull_request events.
  • Update dependencies in pyproject.toml, including black and flake8.
  • Add Michael Della Bitta as an author in pyproject.toml.
  • Introduce wikimedia/setup.cfg with Flake8 configuration (max-line-length = 88).
  • Refactor import paths in wikimedia/entries/upload.py, wikimedia/executors/uploader.py, and wikimedia/utilities/emailer.py.
  • Minor code refactoring in wikimedia/entries/upload.py and wikimedia/executors/uploader.py for better readability and consistency.

Generated with ❤️ by ellipsis.dev

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 8d5fd73 in 1 minute and 20 seconds

More details
  • Looked at 57 lines of code in 2 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pyproject.toml:5
  • Draft comment:
    The authors' list is malformed. Each email should be enclosed in double quotes. Please correct the syntax.
authors = ["Scott Williams <[email protected]>", "Michael Della Bitta <[email protected]>"]
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_HbIAIM6HRfHfc3cP


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on b13904a in 1 minute and 8 seconds

More details
  • Looked at 38 lines of code in 2 files
  • Skipped 1 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_KnslXzLAFONpN0u8


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.11"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python version specified here is 3.11, which is inconsistent with the minimum version requirement of 3.12 in pyproject.toml. Consider aligning the Python versions to avoid potential compatibility issues.

Suggested change
python-version: "3.11"
python-version: "3.12"

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on ccdac88 in 1 minute and 6 seconds

More details
  • Looked at 31 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_q0lMO0yDZNqzAXxH


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.12"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: "3.12"
python-version: "3.11"

Please ensure to use a stable and officially released version of Python. Currently, Python 3.12 is not released, and using Python 3.11 would be more appropriate.

Copy link

gitguardian bot commented Jun 24, 2024

⚠️ GitGuardian has uncovered 14 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
6256332 Triggered Generic High Entropy Secret 48b265c sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 48b265c sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 48b265c sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 48b265c sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret efc4eda sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret efc4eda sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret efc4eda sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 536dda7 sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret efc4eda sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 536dda7 sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 536dda7 sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 536dda7 sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 3e7c625 sdc-sync.py View secret
6256332 Triggered Generic High Entropy Secret 3e7c625 sdc-sync.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 48b265c in 2 minutes and 14 seconds

More details
  • Looked at 3102 lines of code in 12 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. sdc-sync.py:10
  • Draft comment:
    Hardcoding API keys in the source code is a security risk. Consider using environment variables or secure vault solutions to manage sensitive data securely.
  • Reason this comment was not posted:
    Confidence of 20% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_FoXyOFNnz1cKfgRl


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 2d99861 in 1 minute and 20 seconds

More details
  • Looked at 10 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_h1iEt7INWF7Cr4kt


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -0,0 +1,2 @@
[flake8]
max-line-length = 88
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a newline at the end of the file to ensure compatibility with Unix-based tools.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 2f86030 in 43 seconds

More details
  • Looked at 9 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. wikimedia/setup.cfg:2
  • Draft comment:
    Adding a newline at the end of the file is a good practice to ensure proper file formatting and compatibility with POSIX systems.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The file wikimedia/setup.cfg has been modified to include a configuration for Flake8, specifically setting the max-line-length to 88. This is a common practice to ensure code style consistency, especially when using tools like Black which also defaults to a line length of 88. The change is straightforward and aligns with Python code style best practices. However, the diff shows that the only change made was the addition of a newline at the end of the file, which is a good practice to ensure proper file formatting and to avoid issues with POSIX systems where every line should end with a newline character.

Workflow ID: wflow_zRMCzWQw3fnZM3K0


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on b838132 in 1 minute and 14 seconds

More details
  • Looked at 201 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. wikimedia/utilities/emailer.py:58
  • Draft comment:
    The import statement for utilities.helpers should be updated to reflect the new project structure. It should be wikimedia.utilities.helpers.
from wikimedia.utilities.helpers import Text
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_UB1ttHrj7ogWN7z7


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on f3c76d2 in 1 minute and 27 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_NQUJuCbardk0IKEb


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

- name: flake8 Lint
uses: py-actions/flake8@v2
with:
max-line-length: "88"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The max-line-length setting here is redundant because it is already configured in wikimedia/setup.cfg. Consider removing it from this workflow to centralize configuration and avoid potential inconsistencies.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 536dda7 in 2 minutes and 34 seconds

More details
  • Looked at 2873 lines of code in 6 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/lint.yml:1
  • Draft comment:
    The PR description mentions the addition of a new workflow for Black linting, but the existing black.yml file is being deleted and no new file is added. Please clarify if a new workflow file is supposed to be added or if this deletion is intentional.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_c8y9PZm7wVGgmDFP


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on eb831df in 2 minutes and 27 seconds

More details
  • Looked at 36 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/lint.yml:31
  • Draft comment:
    The Mypy command lacks specific configuration settings. Consider adding a mypy.ini file or specifying command-line options to ensure consistent and correct type checking.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_khU4O9zl7FoExkjX


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on bde8a37 in 1 minute and 36 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_u3RsP3WTbp9yzVW5


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specified Python version '3.12' does not exist. Please use a valid Python version, such as '3.11'.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on dc3b467 in 1 minute and 34 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/lint.yml:26
  • Draft comment:
    The mypy check is missing from the linting workflow. If mypy is intended to be part of the linting process, consider adding it back to ensure type checks are performed.
      - name: mypy
        run: |
          cd wikimedia
          PYTHONPATH=. poetry run mypy
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_T64EG9utkWp2FILk


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 7e1c7c8 in 1 minute and 48 seconds

More details
  • Looked at 40 lines of code in 2 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pyproject.toml:27
  • Draft comment:
    The PR description mentions updating dependencies including mypy, but there are no changes related to mypy in pyproject.toml. Please ensure that all intended updates are correctly reflected in the file.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_OTyYfUr5mpynddnW


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

gitguardian bot commented Jun 25, 2024

⚠️ GitGuardian has uncovered 14 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
2897219 Triggered Generic High Entropy Secret 6afc67e sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret 60d1a99 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret f6433d6 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret 6afc67e sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret e8dc412 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret e8dc412 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret 60d1a99 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret f6433d6 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret 6afc67e sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret e8dc412 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret 6afc67e sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret f6433d6 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret f6433d6 sdc-sync.py View secret
2897219 Triggered Generic High Entropy Secret e8dc412 sdc-sync.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 6e9acec in 1 minute and 26 seconds

More details
  • Looked at 40 lines of code in 2 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pyproject.toml:27
  • Draft comment:
    The PR description mentions updating dependencies in pyproject.toml, but the changes are actually made in requirements.txt. Please ensure the PR description accurately reflects the changes made.
  • Reason this comment was not posted:
    Based on historical feedback, this comment is too similar to comments previously marked by users as bad.

Workflow ID: wflow_JIXnm4vaYl20aSyW


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@mdellabitta mdellabitta merged commit 969a495 into main Jun 25, 2024
3 checks passed
@mdellabitta mdellabitta deleted the add-black branch June 25, 2024 20:12
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.

1 participant