Skip to content

Commit

Permalink
chore: formatting uniformization for c and js
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarlin-zama committed Jan 9, 2025
1 parent 7512947 commit 79ee4b4
Show file tree
Hide file tree
Showing 9 changed files with 1,248 additions and 1,037 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ fmt_js: check_nvm_installed
source ~/.nvm/nvm.sh && \
nvm install $(NODE_VERSION) && \
nvm use $(NODE_VERSION) && \
$(MAKE) -C tfhe/web_wasm_parallel_tests fmt
$(MAKE) -C tfhe/web_wasm_parallel_tests fmt && \
$(MAKE) -C tfhe/js_on_wasm_tests fmt

.PHONY: fmt_gpu # Format rust and cuda code
fmt_gpu: install_rs_check_toolchain
Expand Down Expand Up @@ -272,7 +273,8 @@ check_fmt_js: check_nvm_installed
source ~/.nvm/nvm.sh && \
nvm install $(NODE_VERSION) && \
nvm use $(NODE_VERSION) && \
$(MAKE) -C tfhe/web_wasm_parallel_tests check_fmt
$(MAKE) -C tfhe/web_wasm_parallel_tests check_fmt && \
$(MAKE) -C tfhe/js_on_wasm_tests check_fmt

.PHONY: check_typos # Check for typos in codebase
check_typos: install_typos_checker
Expand Down
2 changes: 1 addition & 1 deletion tfhe/c_api_tests/test_high_level_zk.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int main(void) {
ShortintPBSParameters params = SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
assert(params.encryption_key_choice == ShortintEncryptionKeyChoiceBig);

ShortintCompactPublicKeyEncryptionParameters pke_params = SHORTINT_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
ShortintCompactPublicKeyEncryptionParameters pke_params = SHORTINT_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;

int status;

Expand Down
4 changes: 4 additions & 0 deletions tfhe/js_on_wasm_tests/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
node_modules/
pkg/
test/benchmark_results/
9 changes: 9 additions & 0 deletions tfhe/js_on_wasm_tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.PHONY: fmt # Format Javascript code
fmt:
npm install
npm run format

.PHONY: check_fmt # Check Javascript code format
check_fmt:
npm install
npm run check-format
7 changes: 6 additions & 1 deletion tfhe/js_on_wasm_tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
"description": "JS API tests",
"main": "index.js",
"scripts": {
"test": "node --test --test-reporter=tap"
"test": "node --test --test-reporter=tap",
"format": "prettier . --write",
"check-format": "prettier . --check"
},
"devDependencies": {
"prettier": "^3.3.3"
},
"author": "",
"license": "BSD-3-Clause-Clear"
Expand Down
Loading

0 comments on commit 79ee4b4

Please sign in to comment.