Unverified Commit 8453d7e1 authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Adds pre-commit for checking files larger than 2 MB (#463)

# Description

Many users in a single organization mistakenly push large files to the
repository. However, they should be using Git LFS for such purposes.
This MR adds a pre-commit check to complain if a file is more than 2 MB.

It also upgrades pre-commit for all. This is needed due to some
[security reasons with black
formatter](https://github.com/psf/black/releases/tag/24.3.0).

## Type of change

- New feature (non-breaking change which adds functionality)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have run all the tests with `./orbit.sh --test` and they pass
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
parent f6ec7e21
repos:
- repo: https://github.com/python/black
rev: 24.1.1
rev: 24.3.0
hooks:
- id: black
args: ["--line-length", "120", "--preview"]
args: ["--line-length", "120", "--unstable"]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
......@@ -15,6 +15,8 @@ repos:
- id: trailing-whitespace
- id: check-symlinks
- id: destroyed-symlinks
- id: check-added-large-files
args: ["--maxkb=2000"] # restrict files more than 2 MB. Should use git-lfs instead.
- id: check-yaml
- id: check-merge-conflict
- id: check-case-conflict
......@@ -31,7 +33,7 @@ repos:
name: isort (python)
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.1
hooks:
- id: pyupgrade
args: ["--py310-plus"]
......
......@@ -448,7 +448,7 @@ class reset_joints_within_range(ManagerTermBase):
# check if the cfg has the required parameters
if "position_range" not in cfg.params or "velocity_range" not in cfg.params:
raise ValueError(
f"The term 'reset_joints_within_range' requires parameters: 'position_range' and 'velocity_range'."
"The term 'reset_joints_within_range' requires parameters: 'position_range' and 'velocity_range'."
f" Received: {list(cfg.params.keys())}."
)
......
......@@ -34,13 +34,13 @@ parser.add_argument(
"--draw",
action="store_true",
default=False,
help="Draw the obtained pointcloud on viewport from the perspective of camera at index specified by ``--camera_id``.",
help="Draw the pointcloud from camera at index specified by ``--camera_id``.",
)
parser.add_argument(
"--save",
action="store_true",
default=False,
help="Draw the obtained pointcloud on viewport from the perspective of camera at index specified by ``--camera_id``.",
help="Save the data from camera at index specified by ``--camera_id``.",
)
parser.add_argument(
"--camera_id",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment