mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-10 06:54:12 +00:00
be1389420b
* SQL format checking, 1. * SQL format checking, 2. * SQL format checking, 3. * SQL format checking, 4. * SQL format checking, 5. * Running pg_format * Getting rid of comment. * Upping pg_format version. * Using git ls-files for sql format check. * Fixing sql lints. * Addressing PR comments.
31 lines
1,007 B
Bash
Executable file
31 lines
1,007 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
|
|
cd $CWD/../
|
|
|
|
cargo clippy --workspace --fix --allow-staged --allow-dirty --tests --all-targets --all-features -- \
|
|
-D warnings -D deprecated -D clippy::perf -D clippy::complexity \
|
|
-D clippy::style -D clippy::correctness -D clippy::suspicious \
|
|
-D clippy::dbg_macro -D clippy::inefficient_to_string \
|
|
-D clippy::items-after-statements -D clippy::implicit_clone \
|
|
-D clippy::wildcard_imports -D clippy::cast_lossless \
|
|
-D clippy::manual_string_new -D clippy::redundant_closure_for_method_calls \
|
|
-D clippy::unused_self \
|
|
-A clippy::uninlined_format_args \
|
|
-D clippy::get_first \
|
|
-D clippy::explicit_into_iter_loop \
|
|
-D clippy::explicit_iter_loop \
|
|
-D clippy::needless_collect \
|
|
-D clippy::unwrap_used \
|
|
-D clippy::indexing_slicing
|
|
|
|
# Format rust files
|
|
cargo +nightly fmt
|
|
|
|
# Format toml files
|
|
taplo format
|
|
|
|
# Format sql files
|
|
find migrations -type f -name '*.sql' -exec pg_format -i {} +
|