facebook / Ax

Adaptive Experimentation Platform
https://ax.dev
MIT License
2.38k stars 312 forks source link

Add pre-commit hook to Ax #3082

Open CompRhys opened 2 days ago

CompRhys commented 2 days ago

Mirrors PR to botorch: https://github.com/pytorch/botorch/pull/2632 applying the same solution to ensure that there is eventual consistency to the source of truth in requirements-fmt.txt.

Fixes flake8 errors that occured when running

(base) ➜  Ax git:(pre-commit) ✗ pre-commit run --all-files
[INFO] Installing environment for https://github.com/pycqa/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Check pre-commit formatting versions.....................................Passed
Format files with µfmt...................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

ax/benchmark/tests/problems/test_mixed_integer_problems.py:60:23: E226 missing whitespace around arithmetic operator
ax/benchmark/tests/problems/test_mixed_integer_problems.py:70:23: E226 missing whitespace around arithmetic operator
ax/benchmark/tests/problems/test_mixed_integer_problems.py:76:29: E226 missing whitespace around arithmetic operator
ax/benchmark/tests/problems/test_mixed_integer_problems.py:77:29: E226 missing whitespace around arithmetic operator
ax/benchmark/tests/problems/test_mixed_integer_problems.py:78:29: E226 missing whitespace around arithmetic operator
ax/benchmark/tests/problems/test_mixed_integer_problems.py:84:23: E226 missing whitespace around arithmetic operator
ax/benchmark/tests/problems/test_mixed_integer_problems.py:90:29: E226 missing whitespace around arithmetic operator
ax/benchmark/tests/problems/test_mixed_integer_problems.py:91:29: E226 missing whitespace around arithmetic operator
ax/modelbridge/tests/test_prediction_utils.py:165:39: E226 missing whitespace around arithmetic operator
ax/service/tests/test_global_stopping.py:50:43: E226 missing whitespace around arithmetic operator
scripts/insert_api_refs.py:47:35: E226 missing whitespace around arithmetic operator
facebook-github-bot commented 2 days ago

@Cesar-Cardoso has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

codecov-commenter commented 2 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.69%. Comparing base (7b671dc) to head (8caab1d). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3082 +/- ## ======================================= Coverage 95.69% 95.69% ======================================= Files 488 488 Lines 49510 49510 ======================================= Hits 47381 47381 Misses 2129 2129 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: