Skip to content

Commit

Permalink
devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-babichenko committed Jun 11, 2024
1 parent d1c07b2 commit 2c693c8
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:latest
RUN apk add git rust go nodejs npm \
&& go install github.com/evilmartians/lefthook@latest \
&& npm install -g prettier
ENV PATH=${PATH}:/root/go/bin
10 changes: 10 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "fixit",
"build": { "dockerfile": "Dockerfile" },
"postAttachCommand": "lefthook install",
"customizations": {
"vscode": {
"extensions": ["rust-lang.rust-analyzer", "esbenp.prettier-vscode"]
}
}
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tabWidth": 2,
"printWidth": 80,
"proseWrap": "always"
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ run automatically and added to your shell history.

## Installation

### From source
### `cargo`

You will need the [Rust toolchain][rust]. Download this repository and run this
command:

cargo install --path <path-to-repo>
cargo install --git https://github.com/eugene-babichenko/fixit

## Shell setup

Expand Down
9 changes: 9 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pre-commit:
commands:
prettier:
glob: "*.{md,json,prettierrc}"
run: prettier --check {all_files}
rustfmt:
run: cargo fmt
clippy:
run: cargo clippy -- -D warnings

0 comments on commit 2c693c8

Please sign in to comment.