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

[Doc] Run pre-commit hooks on doc/ #42587

Open
peytondmurray opened this issue Jan 22, 2024 · 1 comment
Open

[Doc] Run pre-commit hooks on doc/ #42587

peytondmurray opened this issue Jan 22, 2024 · 1 comment
Labels
docs An issue or change related to documentation P2 Important issue, but not time-critical

Comments

@peytondmurray
Copy link
Contributor

peytondmurray commented Jan 22, 2024

Description

None of the git hooks we currently enforce touch doc/. This means that we currently have no linting and formatting on any of the docs, unless a developer uses the opt-in pre-commit hooks.

This is a problem because we don't have static analysis or consistent code formatting for anything in docs/. This issue is to propose running pre-commit on docs/ in order to minimize future formatting issues related to docs PRs, and to establish consistent code style.

Link

No response

@peytondmurray peytondmurray added P1 Issue that should be fixed within a few weeks docs An issue or change related to documentation labels Jan 22, 2024
@peytondmurray peytondmurray self-assigned this Jan 22, 2024
@peytondmurray peytondmurray added triage Needs triage (eg: priority, bug/not-bug, and owning component) and removed P1 Issue that should be fixed within a few weeks labels Jan 23, 2024
@angelinalg angelinalg added P2 Important issue, but not time-critical and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Jan 23, 2024
@peytondmurray
Copy link
Contributor Author

After discussion with @aslonnie, I'll be breaking this up into a number of small PRs to avoid impacting a lot of code owners at once.

can-anyscale pushed a commit that referenced this issue Aug 16, 2024
## Why are these changes needed?

Currently we have no linting on any part of the docs code. This PR runs
pre-commit on the rllib docs.

This PR fixes the following issues:

```
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing doc/source/rllib/rllib-rlmodule.rst
Fixing doc/source/rllib/rllib-offline.rst
Fixing doc/source/rllib/images/catalog/ppo_catalog_and_rlm_diagram.svg
Fixing doc/source/rllib/key-concepts.rst
Fixing doc/source/rllib/rllib-fault-tolerance.rst
Fixing doc/source/rllib/images/connector-diagram.svg
Fixing doc/source/rllib/images/catalog/catalog_rlmspecs_diagram.svg
Fixing doc/source/rllib/images/catalog/catalog_and_rlm_diagram.svg
Fixing doc/source/rllib/rllib-learner.rst

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing doc/source/rllib/package_ref/policy.rst
Fixing doc/source/rllib/images/episodes/sa_episode_getters.svg
Fixing doc/source/rllib/images/algos/sac-architecture.svg
Fixing doc/source/rllib/package_ref/evaluation.rst
Fixing doc/source/rllib/images/multi-flat.svg
Fixing doc/source/rllib/images/algos/marwil-architecture.svg
Fixing doc/source/rllib/images/rllib-config.svg
Fixing doc/source/rllib/images/sigils/cont-actions.svg
Fixing doc/source/rllib/images/sigils/rllib-sigil-vector-envs.svg
Fixing doc/source/rllib/images/algos/ppo-architecture.svg
Fixing doc/source/rllib/images/sigils/rllib-sigil-tf-and-torch.svg
Fixing doc/source/rllib/images/a2c-arch.svg
Fixing doc/source/rllib/images/sigils/rllib-sigil-distributed-learning.svg
Fixing doc/source/rllib/images/episodes/sa_episode_non_finalized.svg
Fixing doc/source/rllib/images/dqn-arch.svg
Fixing doc/source/rllib/images/episodes/sa_episode_non_finalized_vs_finalized.svg
Fixing doc/source/rllib/images/algos/appo-architecture.svg
Fixing doc/source/rllib/images/sigils/rllib-sigil-multi-agent.svg
Fixing doc/source/rllib/images/sigils/multi-gpu.svg
Fixing doc/source/rllib/images/episodes/usage_of_episodes.svg
Fixing doc/source/rllib/images/rollout_worker_class_overview.svg
Fixing doc/source/rllib/images/catalog/ppo_catalog_and_rlm_diagram.svg
Fixing doc/source/rllib/images/sigils/new-api-stack.svg
Fixing doc/source/rllib/images/sigils/old-api-stack.svg
Fixing doc/source/rllib/images/sigils/rllib-sigil-offline-rl.svg
Fixing doc/source/rllib/key-concepts.rst
Fixing doc/source/rllib/images/impala-arch.svg
Fixing doc/source/rllib/images/algos/dqn-architecture.svg
Fixing doc/source/rllib/images/episodes/sa_episode.svg
Fixing doc/source/rllib/images/sigils/rllib-sigil-external-simulators.svg
Fixing doc/source/rllib/images/episodes/sa_episode_finalized.svg
Fixing doc/source/rllib/images/rllib-envs.svg
Fixing doc/source/rllib/images/dreamerv3/atari100k_1_vs_4gpus.svg
Fixing doc/source/rllib/images/apex-arch.svg
Fixing doc/source/rllib/images/rllib-index-header.svg
Fixing doc/source/rllib/images/algos/icm-architecture.svg
Fixing doc/source/rllib/images/sigils/multi-agent.svg
Fixing doc/source/rllib/images/sigils/multi-node-multi-gpu.svg
Fixing doc/source/rllib/images/env_classes_overview.svg
Fixing doc/source/rllib/images/connector-diagram.svg
Fixing doc/source/rllib/images/rllib-components.svg
Fixing doc/source/rllib/images/algos/impala-architecture.svg
Fixing doc/source/rllib/images/rllib-sample-collection.svg
Fixing doc/source/rllib/images/policy_classes_overview.svg
Fixing doc/source/rllib/images/dreamerv3/dmc_1_vs_4gpus.svg
Fixing doc/source/rllib/images/algos/dreamerv3-architecture.svg
Fixing doc/source/rllib/package_ref/replay-buffers.rst
Fixing doc/source/rllib/images/catalog/catalog_rlmspecs_diagram.svg
Fixing doc/source/rllib/images/dreamerv3/pong_1_2_and_4gpus.svg
Fixing doc/source/rllib/images/ddppo-arch.svg
Fixing doc/source/rllib/images/multi-agent.svg
Fixing doc/source/rllib/images/rllib-logo.svg
Fixing doc/source/rllib/images/algos/curiosity-architecture.svg
Fixing doc/source/rllib/images/episodes/sa_episode_cut_and_lookback.svg
Fixing doc/source/rllib/images/rllib-trajectory-view-example.svg
Fixing doc/source/rllib/images/rllib-api.svg
Fixing doc/source/rllib/images/rllib-stack.svg
Fixing doc/source/rllib/images/sigils/discr-actions.svg
Fixing doc/source/rllib/images/algos/bc-architecture.svg
Fixing doc/source/rllib/images/rllib-batch-modes.svg
Fixing doc/source/rllib/images/rllib-external.svg
Fixing doc/source/rllib/images/catalog/catalog_and_rlm_diagram.svg
Fixing doc/source/rllib/images/sigils/single-agent.svg
Fixing doc/source/rllib/package_ref/utils.rst
Fixing doc/source/rllib/images/trainer_class_overview.svg
Fixing doc/source/rllib/rllib-learner.rst

check for added large files..............................................Passed
check python ast.........................................................Passed
check json...........................................(no files to check)Skipped
check toml...........................................(no files to check)Skipped
black....................................................................Passed
flake8...................................................................Passed
prettier.............................................(no files to check)Skipped
mypy.................................................(no files to check)Skipped
isort (python)...........................................................Passed
rst directives end with two colons.......................................Passed
rst ``inline code`` next to normal text..................................Failed
- hook id: rst-inline-touching-normal
- exit code: 1

doc/source/rllib/rllib-advanced-api.rst:268:An evaluation step runs - using its own ``EnvRunner``s - for ``evaluation_duration``

use logger.warning(......................................................Passed
check for not-real mock methods..........................................Passed
ShellCheck v0.9.0....................................(no files to check)Skipped
clang-format.........................................(no files to check)Skipped
Google Java Formatter................................(no files to check)Skipped
Check for Ray docstyle violations........................................Passed
Check for Ray import order violations....................................Passed
```

## Related issue number

Part of #42587.

## Checks

- [x] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [x] I've run `scripts/format.sh` to lint the changes in this PR.
- [x] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
           corresponding `.rst` file.
- [x] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [x] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(

Signed-off-by: pdmurray <peynmurray@gmail.com>
aslonnie pushed a commit that referenced this issue Aug 27, 2024
## Why are these changes needed?

Currently we have no linting on any part of the docs code. This PR runs
pre-commit on the core docs.

This PR fixes the following issues:

```
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing doc/source/ray-core/examples/overview.rst
Fixing doc/source/ray-core/scheduling/placement-group.rst
Fixing doc/source/ray-core/doc_code/streaming_generator.py
Fixing doc/source/ray-core/tasks.rst
Fixing doc/source/ray-core/actors/terminating-actors.rst
Fixing doc/source/ray-core/scheduling/ray-oom-prevention.rst
Fixing doc/source/ray-core/objects/serialization.rst
Fixing doc/source/ray-core/using-ray-with-jupyter.rst
Fixing doc/source/ray-core/doc_code/ray-dag.py
Fixing doc/source/ray-core/fault_tolerance/tasks.rst
Fixing doc/source/ray-core/actors.rst

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing doc/source/ray-core/user-spawn-processes.rst
Fixing doc/source/ray-core/api/cli.rst
Fixing doc/source/ray-core/images/oom_killer_example_killed_two.svg
Fixing doc/source/ray-core/examples/lm/preprocess.sh
Fixing doc/source/ray-core/examples/plot_hyperparameter.ipynb
Fixing doc/source/ray-core/patterns/concurrent-operations-async-actor.rst
Fixing doc/source/ray-core/images/oom_killer_example_killed_one.svg
Fixing doc/source/ray-core/images/memory.svg
Fixing doc/source/ray-core/actors/terminating-actors.rst
Fixing doc/source/ray-core/scheduling/resources.rst
Fixing doc/source/ray-core/images/oom_killer_example.svg
Fixing doc/source/ray-core/accelerator-types.rst
Fixing doc/source/ray-core/examples/images/batch-training.svg
Fixing doc/source/ray-core/images/physical_resources_vs_logical_resources.svg
Fixing doc/source/ray-core/images/pong-arch.svg
Fixing doc/source/ray-core/fault_tolerance/actors.rst
Fixing doc/source/ray-core/examples/images/automl.svg
Fixing doc/source/ray-core/examples/BUILD

check for added large files..............................................Passed
check python ast.........................................................Passed
check json...............................................................Passed
check toml...........................................(no files to check)Skipped
black....................................................................Passed
flake8...................................................................Passed
prettier.............................................(no files to check)Skipped
mypy.................................................(no files to check)Skipped
isort (python)...........................................................Passed
rst directives end with two colons.......................................Passed
rst ``inline code`` next to normal text..................................Failed
- hook id: rst-inline-touching-normal
- exit code: 1

doc/source/ray-core/actors.rst:427:Ray tracks all child and Actor Tasks. When the``recursive=True`` argument is given,

use logger.warning(......................................................Passed
check for not-real mock methods..........................................Passed
ShellCheck v0.9.0........................................................Passed
clang-format.........................................(no files to check)Skipped
Google Java Formatter................................(no files to check)Skipped
Check for Ray docstyle violations........................................Passed
Check for Ray import order violations....................................Passed
```



## Related issue number

Part of #42587.

## Checks

- [x] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [x] I've run `scripts/format.sh` to lint the changes in this PR.
- [x] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
           corresponding `.rst` file.
- [x] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [x] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(

Signed-off-by: pdmurray <peynmurray@gmail.com>
@peytondmurray peytondmurray removed their assignment Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs An issue or change related to documentation P2 Important issue, but not time-critical
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants