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

feat(lint): make testing lint easier #1753

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions containerized_lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

CONTAINER_ENGINE=${CONTAINER_ENGINE:-docker}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would place this script somewhere in the docs, so ppl will know that they can use it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably note that this variable exists and how to use it in the same doc


${CONTAINER_ENGINE} build --file ./testing.Dockerfile --tag test .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to build the docker each time- lets just use one we will publish ourselves

${CONTAINER_ENGINE} run --rm --interactive --tty --volume $(pwd -P):$(pwd) --workdir $(pwd) test bash ./lint_clean_files.sh
12 changes: 12 additions & 0 deletions testing.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM fedora
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so should we use this dockerfile or the one in the other repo? this one is more minimal...

I vote that we will use this one, just put this in here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I have 2 is this one is based on fedora and is a little heavier, and the other is an alpine with only the requirements.

But I am glad to move to this as it's my go-to container as of late

RUN yum install --assumeyes \
ShellCheck \
python-devel \
python \
golang \
pip \
&& \
yum clean all
RUN pip3 install pre-commit
RUN GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt &&\
ln -s ~/go/bin/shfmt /usr/local/bin