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

Enable precommit inside gisnav container #131

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions debian/gisnav/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ $(BUILD_DIR)/etc/systemd:
@cp -r etc/systemd/ $@

$(BUILD_DIR)/etc/gisnav: $(BUILD_DIR)/etc/gisnav/ros $(BUILD_DIR)/etc/gisnav/docker $(BUILD_DIR)/etc/gisnav/docs
@dest=debian/gisnav/$@ && \
mkdir -p $@ && \
touch $(BUILD_DIR)/COLCON_IGNORE && \
cd ${REPO_ROOT_PATH}; rsync -av --exclude-from='.gitignore' Makefile .pre-commit-config.yaml LICENSE.md README.md pyproject.toml $$dest

$(BUILD_DIR)/etc/gisnav/ros:
@dest=debian/gisnav/$@ && \
Expand Down
6 changes: 6 additions & 0 deletions docker/mavros/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ COPY ros/gisnav/package.xml gisnav/ros/gisnav/package.xml
# the setup.py python dependencies later.
RUN cd gisnav/ros/gisnav && \
rosdep update && \
apt-get update && \
rosdep install --from-paths . -y -r --ignore-src && \
rm -rf /var/lib/apt/lists/* && \
apt clean
Expand Down Expand Up @@ -126,4 +127,9 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | b
&& cd docs/vitepress \
&& npm install

COPY Makefile .pre-commit-config.yaml LICENSE.md README.md pyproject.toml /opt/colcon_ws/src/gisnav/

# .git needed to make pre-commit work -> initialize a blank repo
RUN git init

ENTRYPOINT ["/entrypoint.sh"]
3 changes: 2 additions & 1 deletion ros/gisnav/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ test-launch:
test-unit:
@python3 -m unittest discover -s $(MAKEFILE_DIR)test/unit -p "test_*.py"

# TODO: move test-static to same directory as .pre-commit-config.yaml
.PHONY: test-static
test-static:
@pre-commit run --all-files --config $(MAKEFILE_DIR).pre-commit-config.yaml
@pre-commit run --all-files --config $(MAKEFILE_DIR)/../../.pre-commit-config.yaml
# test end
Loading