Skip to content

Commit

Permalink
Add checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Sadym committed Dec 2, 2022
1 parent c67515e commit 1a75a4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,12 @@ jobs:
with:
name: cddl
path: "*.cddl"
no-split-vars:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Check no break lines inside blocks
run: node ./scripts/formatter/no_split_var.js
3 changes: 2 additions & 1 deletion scripts/formatter/no_split_var.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const specLines = fs.readFileSync(specPath, 'utf-8')
.split('\n');

let failed = [];
const openClosePairs = [["[=", "=]"], ["<dfn", "</dfn"], ["<var", "</var"], ["[", "]"], ["<code", "</code"]];
const openClosePairs = [["[=", "=]"], ["<dfn", "</dfn"], ["<var", "</var"],
["[", "]"], ["<code", "</code"]];

for (let i = 0; i < specLines.length; i++) {
const line = specLines[i];
Expand Down
3 changes: 0 additions & 3 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ $ROOT/scripts/cddl/generate.js

cddl compile-cddl --cddl local.cddl
cddl compile-cddl --cddl remote.cddl

# Check break lines inside blocks.
$ROOT/scripts/formatter/no_split_var.js

0 comments on commit 1a75a4a

Please sign in to comment.