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

Replace pre-commit with Ultralytics Actions #12572

Closed
wants to merge 5 commits into from
Closed

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jan 3, 2024

This pull request adds an improved Ultralytics Actions workflow to automatically format code and documentation to the new Ultralytics official standards maintained at https://github.com/ultralytics/actions.

Four individual actions are run by default. To disable actions, set them to false, i.e. 'python: false'.

To customize an action use a pyproject.toml file in this repo, and see the individual action repo for details.

name: Ultralytics Actions

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - name: Run Ultralytics Formatting
        uses: ultralytics/actions@main
        with:
          python: true
          docstrings: true
          markdown: true
          spelling: true

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

WARNING ⚠️ this PR is very large, summary may not cover all changes.

🌟 Summary

Implemented automatic code formatting and standards enforcement for Ultralytics PRs.

📊 Key Changes

  • Added a new GitHub workflow for automatic formatting
  • Removed previous pre-commit configuration
  • Updated contributing guidelines
  • Cleaned up various documentation and README files
  • Adjusted several configuration files to match the new formatting standards

🎯 Purpose & Impact

  • Ensures consistency: Codebase will maintain a consistent style, making it easier to read and understand.
  • Saves time: Developers no longer need to manually format code, saving time and effort.
  • Reduces errors: Automated checks decrease the likelihood of formatting errors and enforce best practices.

This pull request adds an improved Ultralytics Actions workflow to automatically format code and documentation to the new Ultralytics official standards maintained at https://github.com/ultralytics/actions.

Four individual actions are run by default. To disable actions, set them to false, i.e. 'python: false'.

To customize an action use a `pyproject.toml` file in this repo, and see the individual action repo for details. 

```yaml
name: Ultralytics Actions

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - name: Run Ultralytics Formatting
        uses: ultralytics/actions@main
        with:
          python: true
          docstrings: true
          markdown: true
          spelling: true
```

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Copy link
Contributor

@akx akx left a comment

Choose a reason for hiding this comment

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

It would probably be good to check the codespell suggestions by hand instead of lumping them in an auto-format commit. I found at least one auto-corrected crate -> create, which is plainly incorrect (since it's hard to detect a create from an image, but crates are more readily there).

This PR also fails to delete the conflicting flake8 + isort + yapf + pre-commit configuration.

" crate 50 0.52 0.82\n",
" create 50 0.52 0.82\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably not a correct typo fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah these exclude words are in the pyproject.toml settings that are missing from this PR, I need to add it!

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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.

None yet

2 participants