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

[CI] Format Python code with Black #21316

Closed
Tracked by #21311
bveeramani opened this issue Dec 31, 2021 · 0 comments · Fixed by #21975
Closed
Tracked by #21311

[CI] Format Python code with Black #21316

bveeramani opened this issue Dec 31, 2021 · 0 comments · Fixed by #21975
Assignees

Comments

@bveeramani
Copy link
Member

bveeramani commented Dec 31, 2021

Once format.sh has been updated to support the Black code style (#21312) and we've preemptively fixed as many Black-related issues as possible (#21313, #21314, #21315), we can actually format the Python code with Black. Here's how we can achieve that:

  1. Set the BLACK_FORMATTER_ENABLED flag to true in format.sh (see [CI] Update format.sh to support the Black code style #21312)
  2. Run ./scripts/format.sh
  3. Add noqa comments on lines that are too long.
python/ray/_private/function_manager.py:218:89: E501 line too long (89 > 88 characters)
python/ray/actor.py:1219:89: E501 line too long (103 > 88 characters)
python/ray/autoscaler/_private/updater.py:420:89: E501 line too long (90 > 88 characters)
python/ray/node.py:1016:89: E501 line too long (115 > 88 characters)
python/ray/serve/api.py:251:89: E501 line too long (90 > 88 characters)
python/ray/state.py:365:89: E501 line too long (108 > 88 characters)
python/ray/tests/aws/utils/stubs.py:24:89: E501 line too long (98 > 88 characters)
python/ray/tests/test_autoscaler_yaml.py:484:89: E501 line too long (97 > 88 characters)
python/ray/util/client/server/dataservicer.py:65:89: E501 line too long (90 > 88 characters)
release/alert.py:159:89: E501 line too long (109 > 88 characters)
rllib/examples/env/coin_game_vectorized_env.py:176:89: E501 line too long (92 > 88 characters)
rllib/policy/tf_policy.py:564:89: E501 line too long (89 > 88 characters)
rllib/policy/torch_policy.py:1036:89: E501 line too long (89 > 88 characters)
  1. Manually move noqa comments that have been moved out of place.
python/ray/serve/tests/test_fastapi.py:585:9: F811 redefinition of unused 'method' from line 581
python/ray/train/examples/transformers/transformers_example.py:404:40: E741 ambiguous variable name 'l'
python/ray/tune/logger.py:739:1: E402 module level import not at top of file
python/ray/tune/utils/util.py:20:1: F401 'ray.util.ml_utils.dict.merge_dicts' imported but unused
python/ray/tune/utils/util.py:20:1: F401 'ray.util.ml_utils.dict.deep_update' imported but unused
python/ray/tune/utils/util.py:20:1: F401 'ray.util.ml_utils.dict.flatten_dict' imported but unused
python/ray/tune/utils/util.py:20:1: F401 'ray.util.ml_utils.dict.unflatten_dict' imported but unused
python/ray/tune/utils/util.py:20:1: F401 'ray.util.ml_utils.dict.unflatten_list_dict' imported but unused
python/ray/tune/utils/util.py:20:1: F401 'ray.util.ml_utils.dict.unflattened_lookup' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.LAST_TARGET_UPDATE_TS' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.NUM_TARGET_UPDATES' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.APPLY_GRADS_TIMER' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.COMPUTE_GRADS_TIMER' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.WORKER_UPDATE_TIMER' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.GRAD_WAIT_TIMER' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.SAMPLE_TIMER' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.LEARN_ON_BATCH_TIMER' imported but unused
rllib/execution/common.py:7:1: F401 'ray.rllib.utils.metrics.LOAD_BATCH_TIMER' imported but unused
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 a pull request may close this issue.

1 participant