Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci/typo checker #362

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
working-directory: ./frontend
- name: Format
run: cargo fmt --all -- --check

clippy-check:
runs-on: ubuntu-latest
needs: test
Expand All @@ -141,3 +142,10 @@ jobs:
working-directory: ./frontend
- name: Clippy
run: cargo clippy --all-features --all-targets -- -D warnings -D clippy::dbg_macro -A clippy::empty_docs

typo-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: typos-action
uses: crate-ci/typos@v1.23.6
2 changes: 2 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[files]
extend-exclude = ["integration-tests/*", "CHANGELOG.md"]
10 changes: 5 additions & 5 deletions examples/main.zhang
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ option "operating_currency" "CNY"
1970-01-01 open Expenses:Clothing CNY, USD
1970-01-01 open Expenses:Medical CNY, USD
1970-01-01 open Expenses:Sport CNY, USD
1970-01-01 open Expenses:Transportaion CNY, USD
1970-01-01 open Expenses:Transportation CNY, USD
1970-01-01 open Expenses:GrandLordCompany:Tax CNY, USD
1970-01-01 open Expenses:RemunerationTax CNY, USD


1970-01-01 open Equity:OpenBlancing CNY, USD
1970-01-01 open Equity:OpenBalancing CNY, USD


2023-05-31 01:01:01 balance Assets:Paypal 135125 CNY with pad Equity:OpenBlancing
2023-05-31 01:01:01 balance Assets:WeChat 146340 CNY with pad Equity:OpenBlancing
2023-05-31 01:01:01 balance Assets:CitiBank:9999 158059 CNY with pad Equity:OpenBlancing
2023-05-31 01:01:01 balance Assets:Paypal 135125 CNY with pad Equity:OpenBalancing
2023-05-31 01:01:01 balance Assets:WeChat 146340 CNY with pad Equity:OpenBalancing
2023-05-31 01:01:01 balance Assets:CitiBank:9999 158059 CNY with pad Equity:OpenBalancing



Expand Down
12 changes: 6 additions & 6 deletions extensions/beancount/src/beancount.pest
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ tags = { (space* ~ tag)* }
tag = { "#" ~ unquote_string }
links = { (space* ~ link)* }
link = { "^" ~ unquote_string }
transaction_detail = _{ identation_push ~ transaction_lines ~ DROP }
transaction_detail = _{ indentation_push ~ transaction_lines ~ DROP }
transaction_lines = { transaction_line ~ (transaction_next_line)* }
transaction_line = { (transaction_posting | key_value_line) ~ space* ~ valuable_comment? }
transaction_posting = { transaction_flag? ~ account_name ~ (space+ ~ posting_unit)? ~ metas? }
transaction_next_line = _{ identation ~ transaction_line }
transaction_next_line = _{ indentation ~ transaction_line }

posting_unit = { (posting_amount)? ~ posting_meta }
posting_amount = { number_expr ~ space+ ~ commodity_name }
Expand All @@ -60,15 +60,15 @@ posting_total_price = { "@@" ~ space+ ~ number_expr ~ space+ ~ commodity_name }

string_or_account = { account_name | string }

metas = { identation_push ~ key_value_lines ~ DROP }
metas = { indentation_push ~ key_value_lines ~ DROP }

booking_method = { "\"" ~ ("STRICT" | "FIFO" | "LIFO" | "AVERAGE" | "AVERAGE_ONLY" | "NONE") ~ "\"" }

identation = _{ line ~ PEEK_ALL }
identation_push = _{ identation ~ PUSH(space+) }
indentation = _{ line ~ PEEK_ALL }
indentation_push = _{ indentation ~ PUSH(space+) }

key_value_lines = _{ key_value_line_with_comment ~ (key_value_next_line)* }
key_value_next_line = _{ identation ~ key_value_line_with_comment }
key_value_next_line = _{ indentation ~ key_value_line_with_comment }
key_value_line = { string ~ space* ~ ":" ~ space* ~ string }
key_value_line_with_comment = _{ key_value_line ~ space* ~ comment? }

Expand Down
2 changes: 1 addition & 1 deletion extensions/beancount/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl BeancountParser {
}

#[allow(dead_code)]
fn identation(input: Node) -> Result<()> {
fn indentation(input: Node) -> Result<()> {
Ok(())
}

Expand Down
Loading
Loading