Skip to content

Commit

Permalink
Merge pull request #131 from hmakelin/enable-precommit-inside-container
Browse files Browse the repository at this point in the history
Enable precommit inside gisnav container
  • Loading branch information
hmakelin authored Aug 7, 2024
2 parents 07fd976 + ccfc5f1 commit 6d933be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
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

0 comments on commit 6d933be

Please sign in to comment.