Skip to content

Commit 6d933be

Browse files
authored
Merge pull request #131 from hmakelin/enable-precommit-inside-container
Enable precommit inside gisnav container
2 parents 07fd976 + ccfc5f1 commit 6d933be

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

debian/gisnav/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ $(BUILD_DIR)/etc/systemd:
7979
@cp -r etc/systemd/ $@
8080

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

8387
$(BUILD_DIR)/etc/gisnav/ros:
8488
@dest=debian/gisnav/$@ && \

docker/mavros/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ COPY ros/gisnav/package.xml gisnav/ros/gisnav/package.xml
7777
# the setup.py python dependencies later.
7878
RUN cd gisnav/ros/gisnav && \
7979
rosdep update && \
80+
apt-get update && \
8081
rosdep install --from-paths . -y -r --ignore-src && \
8182
rm -rf /var/lib/apt/lists/* && \
8283
apt clean
@@ -126,4 +127,9 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | b
126127
&& cd docs/vitepress \
127128
&& npm install
128129

130+
COPY Makefile .pre-commit-config.yaml LICENSE.md README.md pyproject.toml /opt/colcon_ws/src/gisnav/
131+
132+
# .git needed to make pre-commit work -> initialize a blank repo
133+
RUN git init
134+
129135
ENTRYPOINT ["/entrypoint.sh"]

ros/gisnav/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ test-launch:
1717
test-unit:
1818
@python3 -m unittest discover -s $(MAKEFILE_DIR)test/unit -p "test_*.py"
1919

20+
# TODO: move test-static to same directory as .pre-commit-config.yaml
2021
.PHONY: test-static
2122
test-static:
22-
@pre-commit run --all-files --config $(MAKEFILE_DIR).pre-commit-config.yaml
23+
@pre-commit run --all-files --config $(MAKEFILE_DIR)/../../.pre-commit-config.yaml
2324
# test end

0 commit comments

Comments
 (0)