style: Use pre-commit tool and add simple config (#2029)

I started with really simple pre-commit hooks and will add more on top.

Important files:
- `.pre-commit-config.yaml` - the config for pre-commit
- `.github/workflows/pre-commit.yml` - runs pre-commit hooks in branches
and `develop`
- `.github/workflows/pre-commit-autoupdate.yml` - autoupdates pre-commit
hooks once in a month
This commit is contained in:
Ayaz Salikhov
2025-04-24 17:59:43 +01:00
committed by GitHub
parent 99580a2602
commit 9c92a2b51b
66 changed files with 805 additions and 733 deletions

View File

@@ -75,7 +75,7 @@ public:
auto static kINSERT_TX_INDEX_EXAMPLE = [this]() {
return handle_.prepare(fmt::format(
R"(
INSERT INTO {}
INSERT INTO {}
(hash, tx_type)
VALUES (?, ?)
)",
@@ -171,7 +171,7 @@ public:
auto static kINSERT_LEDGER_EXAMPLE = [this]() {
return handle_.prepare(fmt::format(
R"(
INSERT INTO {}
INSERT INTO {}
(sequence, account_hash)
VALUES (?, ?)
)",
@@ -319,11 +319,11 @@ private:
statements.emplace_back(fmt::format(
R"(
CREATE TABLE IF NOT EXISTS {}
(
(
hash blob,
tx_type text,
PRIMARY KEY (hash)
)
PRIMARY KEY (hash)
)
)",
data::cassandra::qualifiedTableName(settingsProvider_, "tx_index_example")
));
@@ -331,11 +331,11 @@ private:
statements.emplace_back(fmt::format(
R"(
CREATE TABLE IF NOT EXISTS {}
(
(
sequence bigint,
account_hash blob,
PRIMARY KEY (sequence)
)
PRIMARY KEY (sequence)
)
)",
data::cassandra::qualifiedTableName(settingsProvider_, "ledger_example")
));