Skip to content

Commit

Permalink
feat(cli): Setup Luacheck config in project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Sep 2, 2024
1 parent e7ecee9 commit e03b1f0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ templatesdir = $(datadir)
dist_templates_DATA = \
editorconfig \
gitlab-ci.yml \
luacheckrc \
luarc.json \
zola_book.html \
zola_series.html \
Expand Down
7 changes: 7 additions & 0 deletions luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
std = "lua54+sile"

max_line_length = false

files["pandoc-filters"] = {
std = "+pandoc_filter"
}
4 changes: 4 additions & 0 deletions rules/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ PROJECTCONFIGS += .gitignore
echo '$(IGNORES)' |
$(SED) -e 's/ /\n/g' > $@

PROJECTCONFIGS += .luacheckrc
.luacheckrc: $(CASILEDIR)/luacheckrc
cp $< $@

PROJECTCONFIGS += .luarc.json
.luarc.json: $(CASILEDIR)/luarc.json
cp $< $@
Expand Down
2 changes: 1 addition & 1 deletion src/setup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub fn is_make_gnu() -> Result<bool> {
}

fn regen_dotfiles(repo: Repository) -> Result<()> {
let targets = vec![".editorconfig", ".gitignore", ".luarc.json"];
let targets = vec![".editorconfig", ".gitignore", ".luacheckrc", ".luarc.json"];
let make_targets: Vec<String> = targets.iter().map(|&x| x.into()).collect();
make::run(make_targets)?;
let mut index = repo.index()?;
Expand Down

0 comments on commit e03b1f0

Please sign in to comment.