Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
node-version: "18"
- name: Check formatting
run: |
npm i -g prettier
prettier . --check
npm ci
npm run format:check
pycodestyle:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
node_modules/
out
__pycache__
*.pyc
server.db
out

.terraform*
terraform.tfstate*
Expand Down
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ tofu fmt -check -recursive

This repository uses [Prettier](https://prettier.io/) to format code with its default settings.

To install Prettier, ensure you have Nodejs and npm installed and run `sudo npm i -g prettier`. This install prettier globally to your system.
To install Prettier, ensure you have Nodejs and npm installed and run `npm ci`. This installs prettier to `node_modules` in this directory.

Format code by running:

```sh
prettier . --write
npm run format
```

Check formatting by running:

```sh
prettier . --check
npm run format:check
```

## Run acceptance tests
Expand Down
8 changes: 6 additions & 2 deletions front-end/src/lib/BarChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
{#each choices as choice}
<div class="row" title={choice.title}>
<span>{choice.label}</span>
<div class="bar" style="width: {summary.values[String(choice.value)] / summary.count_non_null * 100}%"
></div>
<div
class="bar"
style="width: {(summary.values[String(choice.value)] /
summary.count_non_null) *
100}%"
></div>
<span>{summary.values[String(choice.value)]}</span>
</div>
{/each}
Expand Down
242 changes: 242 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"scripts": {
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"devDependencies": {
"prettier": "^3.5.3",
"prettier-plugin-svelte": "^3.3.3"
}
}