Add EditorConfig rules, fix trailing whitespaces

This commit is contained in:
Zhaofeng Li 2022-01-08 01:20:36 -08:00
parent deca292b53
commit abb74b9f49
8 changed files with 49 additions and 7 deletions

22
.editorconfig Normal file
View file

@ -0,0 +1,22 @@
# EditorConfig configuration for Colmena
# Top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
# Rust
[*.rs]
indent_style = space
indent_size = 2
# Vendored
[manual/theme/highlight.js]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset

20
.github/workflows/editorconfig.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: Check EditorConfig
on:
pull_request:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: cachix/install-nix-action@v15
- name: Enable binary cache (optional)
uses: cachix/cachix-action@v10
with:
name: colmena
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-shell --run "editorconfig-checker"

View file

@ -52,7 +52,7 @@
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
inputsFrom = [ defaultPackage ]; inputsFrom = [ defaultPackage ];
packages = with pkgs; [ clippy mdbook python3 rust-analyzer ]; packages = with pkgs; [ clippy mdbook python3 editorconfig-checker rust-analyzer ];
shellHook = '' shellHook = ''
export NIX_PATH=nixpkgs=${pkgs.path} export NIX_PATH=nixpkgs=${pkgs.path}
''; '';