Skip to content

Commit 10dac98

Browse files
authored
chore: add .editorconfig, minor cleanups (#32)
1 parent b30aa97 commit 10dac98

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

.editorconfig

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
root = true
22

33
[*]
4-
indent_style = space
5-
indent_size = 4
64
charset = utf-8
7-
trim_trailing_whitespace = true
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
88
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
indent_size = 2
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[LICENSE-*]
18+
indent_size = unset

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ repos:
3333
entry: sh -c "cargo fmt --all"
3434
language: rust
3535
pass_filenames: false
36+
37+
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
38+
rev: 3.6.0
39+
hooks:
40+
- id: editorconfig-checker

justfile

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env just --justfile
22

3-
# Define the name of the main crate based
3+
# Define the name of the main crate based on the directory name
44
main_crate := file_name(justfile_directory())
55
# How to call the current just executable. Note that just_executable() may have `\` in Windows paths, so we need to quote it.
66
just := quote(just_executable())
@@ -31,10 +31,6 @@ build:
3131
check:
3232
cargo check --workspace --all-features --all-targets
3333

34-
# Quick compile for MSRV, without compiling benches
35-
check-msrv:
36-
cargo check --all-targets
37-
3834
# Generate code coverage report to upload to codecov.io
3935
ci-coverage: env-info && \
4036
(coverage '--codecov --output-path target/llvm-cov/codecov.info')
@@ -45,7 +41,8 @@ ci-coverage: env-info && \
4541
ci-test: env-info test-fmt clippy check test test-doc && assert-git-is-clean
4642

4743
# Run minimal subset of tests to ensure compatibility with MSRV
48-
ci-test-msrv: env-info check-msrv test-msrv
44+
ci-test-msrv: env-info
45+
cargo check --all-features --package {{main_crate}}
4946

5047
# Clean all build artifacts
5148
clean:
@@ -123,10 +120,6 @@ test-doc: (docs '')
123120
test-fmt: && (fmt-toml '--check' '--check-format')
124121
cargo fmt --all -- --check
125122

126-
# Run all tests for MSRV
127-
test-msrv:
128-
cargo test --workspace
129-
130123
# Find unused dependencies. Uses `cargo-udeps`
131124
udeps: (cargo-install 'cargo-udeps')
132125
cargo +nightly udeps --workspace --all-features --all-targets
@@ -148,11 +141,11 @@ assert-cmd command:
148141
[private]
149142
assert-git-is-clean:
150143
@if [ -n "$(git status --untracked-files --porcelain)" ]; then \
151-
>&2 echo "ERROR: git repo is no longer clean. Make sure compilation and tests artifacts are in the .gitignore, and no repo files are modified." ;\
152-
>&2 echo "######### git status ##########" ;\
153-
git status ;\
154-
git --no-pager diff ;\
155-
exit 1 ;\
144+
>&2 echo "ERROR: git repo is no longer clean. Make sure compilation and tests artifacts are in the .gitignore, and no repo files are modified." ;\
145+
>&2 echo "######### git status ##########" ;\
146+
git status ;\
147+
git --no-pager diff ;\
148+
exit 1 ;\
156149
fi
157150

158151
# Check if a certain Cargo command is installed, and install it if needed

0 commit comments

Comments
 (0)