Skip to content

Commit

Permalink
use mise to get development dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 18, 2024
1 parent 9b81b2a commit 4ff1e9f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 44 deletions.
8 changes: 2 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ RUN mkdir /workspaces/target \
&& apt-get update \
&& apt-get -y install --no-install-recommends \
# shells, direnv, shellcheck
bash fish zsh direnv nodejs shellcheck \
bash fish zsh direnv nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
# shfmt
&& curl -sS https://webi.sh/shfmt | sh \
# just
&& curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/bin \
# npm packages
&& npm install -g prettier@3.1.0 markdownlint-cli@0.37.0 markdown-magic@2.6.1
&& curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/bin

COPY --from=golang:1.21-bullseye /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ jobs:
- uses: taiki-e/install-action@v2
with:
tool: nextest,just,cargo-deny,cargo-msrv,cargo-machete
- name: Install direnv/shfmt
run: sudo apt-get update; sudo apt-get install direnv shfmt
- run: npm i -g markdown-magic prettier markdownlint-cli
- name: Install direnv
run: sudo apt-get update; sudo apt-get install direnv
- run: cargo nextest run --all-features
env:
RUST_BACKTRACE: "1"
Expand Down Expand Up @@ -72,8 +71,7 @@ jobs:
with:
shared-key: coverage
save-if: ${{ github.ref_name == 'main' }}
- run: sudo apt-get update; sudo apt-get install zsh fish direnv shfmt
- run: npm i -g markdown-magic
- run: sudo apt-get update; sudo apt-get install zsh fish direnv
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,just
Expand Down
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ To use the container with VSCode, you'll need to install the [Remote - Container

- [rust](https://www.rust-lang.org/) stable 1.66.1+ (it might be compatible with earlier, but I haven't tested that). As of this writing: 1.67.0 but GH actions will use the latest stable whenever it runs.
- [just](https://github.com/casey/just) any version should do, but as of this writing I'm on 1.13.0
- [md-magic](https://github.com/DavidWells/markdown-magic)
- [shfmt](https://github.com/mvdan/sh)
- [shellcheck](https://www.shellcheck.net/)

(you'd think we'd use mise to fetch these but frankly it's kind of a pain to dogfood mise while testing it)

Expand Down
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,29 +87,28 @@ scripts := "scripts/*.sh e2e/{test_,run_}* e2e/*.sh"
lint:
cargo clippy -- -Dwarnings
cargo fmt --all -- --check
shellcheck -x {{ scripts }}
shfmt -d {{ scripts }}
mise x shellcheck@latest -- shellcheck -x {{ scripts }}
mise x shfmt@latest -- shfmt -d {{ scripts }}
just --unstable --fmt --check
prettier -c $(git ls-files '*.yml' '*.yaml')
markdownlint .
MISE_EXPERIMENTAL=1 mise x npm:prettier@latest -- prettier -c $(git ls-files '*.yml' '*.yaml')
mise x node@latest -- npx markdownlint .

# runs linters but makes fixes when possible
lint-fix:
cargo clippy --fix --allow-staged --allow-dirty -- -Dwarnings
cargo fmt --all
shellcheck -x {{ scripts }}
shfmt -w {{ scripts }}
mise x shellcheck@latest -- shellcheck -x {{ scripts }}
mise x shfmt@latest -- shfmt -w {{ scripts }}
just --unstable --fmt
prettier -w $(git ls-files '*.yml' '*.yaml')
markdownlint --fix .
MISE_EXPERIMENTAL=1 mise x npm:prettier@latest -- prettier -w $(git ls-files '*.yml' '*.yaml')
mise x node@latest -- npx markdownlint --fix .

render-all: render-help render-completions render-mangen

# regenerate docs/cli-reference.md
render-help: build
NO_COLOR=1 mise render-help
#npx markdown-magic
md-magic
mise x node@latest -- npx markdown-magic

# regenerate shell completion files
render-completions: build
Expand Down
6 changes: 0 additions & 6 deletions packaging/github-actions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ RUN apt-get update \
libyaml-dev \
patch \
pkg-config \
shellcheck \
shfmt \
sudo \
tk-dev \
uuid-dev \
Expand All @@ -53,10 +51,6 @@ RUN apt-get update \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update && apt-get install -y --no-install-recommends nodejs \
&& node -v \
&& npm i -g \
markdown-magic \
markdownlint-cli \
prettier \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \
&& rustup install stable && rustup default stable \
Expand Down

0 comments on commit 4ff1e9f

Please sign in to comment.