Skip to content

Commit

Permalink
Merge pull request #439 from tstromberg/reformat
Browse files Browse the repository at this point in the history
makefile: update sql reformat to use in-place --fix
  • Loading branch information
tstromberg authored Jan 7, 2025
2 parents a3312d6 + c06be50 commit 8001b98
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ out/packs.zip: packs out/osquery.conf

.PHONY: reformat
reformat:
find . -type f -name "*.sql" | perl -ne 'chomp; system("cp $$_ /tmp/fix.sql && npx sql-formatter -l sqlite /tmp/fix.sql > $$_");'
find . -type f -name "*.sql" -exec npx sql-formatter -l sqlite --fix {} \;

.PHONY: reformat-updates
reformat-updates:
git status -s | awk '{ print $$2 }' | grep ".sql" | perl -ne 'chomp; print("$$_\n"); system("cp $$_ /tmp/fix.sql && npx sql-formatter -l sqlite /tmp/fix.sql > $$_");'
git status -s | awk '{ print $$2 }' | grep ".sql" | xargs -n1 npx sql-formatter -l sqlite --fix

.PHONY: detect
detect: ./out/osqtool-$(ARCH)-$(OSQTOOL_VERSION)
Expand Down Expand Up @@ -79,4 +79,3 @@ verify: ./out/osqtool-$(ARCH)-$(OSQTOOL_VERSION)
$(SUDO) ./out/osqtool-$(ARCH)-$(OSQTOOL_VERSION) --workers 1 --max-results=0 --max-query-duration=16s --max-total-daily-duration=2h30m --max-query-daily-duration=1h verify detection

all: out/packs.zip

0 comments on commit 8001b98

Please sign in to comment.