Skip to content

Commit

Permalink
Added pre-commit configuration file (#41)
Browse files Browse the repository at this point in the history
* Added pre-commit configuration file

* Added pre-commit installing instructions in README.md

* Added github action for running linter

* Linted project files
  • Loading branch information
ndelima-ekumen authored Sep 19, 2024
1 parent 482e81f commit f617c15
Show file tree
Hide file tree
Showing 23 changed files with 631 additions and 252 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: pre-commit

on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
isaac_ws/datasets/**
model/*
model/*
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
default_language_version:
python: python3
repos:
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
args: [--safe, --quiet]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
language_version: python3
additional_dependencies:
- flake8-docstrings==1.5.0
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict]
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ We recommend reading this [article](https://docs.omniverse.nvidia.com/isaacsim/l

> **NOTE:** this project is disk savvy, make sure to have tens of GBs (~50GB) available of free disk space.
## Contributing

This projects uses pre-commit hooks for linting. To install and make sure they are run when committing:

```bash
python3 -m pip install -U pre-commit
pre-commit install
```

If you want to run the linters but still not ready to commit you can run:

```bash
pre-commit run --all-files
```

# Using the different docker components

Expand All @@ -32,8 +46,8 @@ The available profiles are:
- `detection`: loads the detection stack.
- `visualization`: loads RQt to visualize the input and output image processing.
- `test_camera`: loads the usb_cam driver that makes a connected webcam to publish. Useful when the Olive Camera is not available.
- `simulation`: loads the simulation NVidia Isaac Omniverse.
- `dataset_gen`: generates a training dataset using NVidia Isaac Omniverse.
- `simulation`: loads the simulation NVidia Isaac Omniverse.
- `dataset_gen`: generates a training dataset using NVidia Isaac Omniverse.
> TBD
Compound profiles are:
Expand Down Expand Up @@ -118,7 +132,7 @@ The following .gif video shows pictures where the ground plane conditions color

![Dataset gen](./doc/dataset_gen.gif)

And once it finishes (note the scene does not evolve anymore) check the generated folder under `isaac_ws/datasets/YYYYMMDDHHMMSS_out_fruit_sdg` where `YYYYMMDDHHMMSS` is the stamp of the dataset creation.
And once it finishes (note the scene does not evolve anymore) check the generated folder under `isaac_ws/datasets/YYYYMMDDHHMMSS_out_fruit_sdg` where `YYYYMMDDHHMMSS` is the stamp of the dataset creation.


# FAQs
Expand All @@ -131,4 +145,4 @@ Your good old friend `docker system prune` and the more agressive `docker system

```bash
xhost +si:localuser:root
```
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Fruit detection module."""
Loading

0 comments on commit f617c15

Please sign in to comment.