Skip to content

Commit

Permalink
Test out Codeflash (#93)
Browse files Browse the repository at this point in the history
* Test out Codeflash

Signed-off-by: GitHub <[email protected]>

* Ignore new lint

Signed-off-by: GitHub <[email protected]>

---------

Signed-off-by: GitHub <[email protected]>
  • Loading branch information
shenanigansd authored Jan 7, 2025
1 parent 8de9ed7 commit ab796d7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/codeflash-optimize.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Codeflash

on:
pull_request:
workflow_dispatch:

jobs:
optimize:
name: Optimize new code in this PR
if: ${{ github.actor != 'codeflash-ai[bot]' }}
runs-on: ubuntu-latest
env:
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
CODEFLASH_PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Project Dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install codeflash
- name: Run Codeflash to optimize code
id: optimize_code
run: |
codeflash
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ select = ["ALL"]
ignore = [
"CPY001", # (Missing copyright notice at top of file)
"S311", # (Standard pseudo-random generators are not suitable for cryptographic purposes) - Really?
"DOC201", # (`return` is not documented in docstring) - TODO
]

[tool.ruff.lint.extend-per-file-ignores]
Expand All @@ -66,3 +67,11 @@ known-first-party = ["imsosorry.uwuification"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.codeflash]
# All paths are relative to this pyproject.toml's directory.
module-root = "src"
tests-root = "tests"
test-framework = "pytest"
ignore-paths = []
formatter-cmds = ["ruff check --exit-zero --fix $file", "ruff format $file"]

0 comments on commit ab796d7

Please sign in to comment.