Skip to content

Commit

Permalink
Merge branch 'dev' into feature/user-cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Aug 13, 2024
2 parents afe4ff3 + 013cca2 commit 50055d1
Show file tree
Hide file tree
Showing 68 changed files with 3,108 additions and 2,048 deletions.
15 changes: 15 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# We'd like to place this file to the .config/ folder as well,
# however Codecov doesn't support it yet (or is buggy, see
# https://github.com/codecov/codecov-action/issues/1465)

# Ignore test files themselves in the Codecov report
# see: https://about.codecov.io/blog/should-i-include-test-files-in-code-coverage-calculations/
ignore:
- "spec/**/*"
- "**/*_spec.rb"

# https://docs.codecov.com/docs/commit-status
coverage:
status:
project: off
patch: off
5 changes: 0 additions & 5 deletions .config/.codecov.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .config/.cypress.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
e2e: {
// Add configuration here
// Base URL is set via Docker environment variable
viewportHeight: 1000,
viewportWidth: 1400,
},
};
49 changes: 49 additions & 0 deletions .config/commands/docker.justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Prints this help message
[private]
help:
@just --list --justfile {{source_file()}}

# Starts the dev docker containers
@up *args:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose up {{args}}

# Starts the dev docker containers and preseeds the database
[confirm("This will reset all your data in the database locally. Continue? (y/n)")]
up-reseed *args:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
export DB_SQL_PRESEED_URL="https://github.com/MaMpf-HD/mampf-init-data/raw/main/data/20220923120841_mampf.sql"
export UPLOADS_PRESEED_URL="https://github.com/MaMpf-HD/mampf-init-data/raw/main/data/uploads.zip"
docker compose rm --stop --force mampf && docker compose up {{args}}

# Removes the development docker containers
@down:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose down

# Stops the development docker containers (without removing them)
@stop:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose stop

# Puts you into a shell of your desired *development* docker container
@shell name="mampf" shell="bash":
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose exec -it {{name}} bash

# Puts you into a shell of your desired *test* docker container
@shell-test name="mampf" shell="bash":
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/test/
docker compose exec -it {{name}} {{shell}}

# Puts you into the rails console of the dev docker mampf container
@rails-c:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose exec mampf bundle exec rails c
14 changes: 14 additions & 0 deletions .config/commands/test.justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Prints this help message
[private]
help:
@just --list --justfile {{source_file()}}

# Starts the interactive Cypress test runner UI
cypress:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/test
docker compose -f docker-compose.yml -f cypress.yml -f cypress-interactive.yml up --exit-code-from cypress

# Opens Codecov in the default browser
codecov:
xdg-open https://app.codecov.io/gh/MaMpf-HD/mampf
2 changes: 2 additions & 0 deletions .config/eslint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ const customGlobals = {

// KaTeX
renderMathInElement: "readable",

openAnnotationIfSpecifiedInUrl: "readable",
};

export default [
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
files: ./coverage/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
codecov_yml_path: ./config/codecov.yml

# Cypress end-to-end tests
e2e-tests:
Expand Down
36 changes: 36 additions & 0 deletions .justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Documentation: https://just.systems/man/en/

# Prints this help message
[private]
help:
@just --list

# Test-related commands
mod test ".config/commands/test.justfile"
# see https://github.com/casey/just/issues/2216
# alias t := test

# Docker-related commands
mod docker ".config/commands/docker.justfile"

# Opens the MaMpf wiki in the default browser
wiki:
#!/usr/bin/env bash
xdg-open https://github.com/MaMpf-HD/mampf/wiki
# Opens the MaMpf pull requests (PRs) in the default browser
prs:
#!/usr/bin/env bash
xdg-open https://github.com/MaMpf-HD/mampf/pulls
# Opens the PR for the current branch in the default browser
pr:
#!/usr/bin/env bash
branchname=$(git branch --show-current)
xdg-open "https://github.com/MaMpf-HD/mampf/pulls?q=is%3Apr+is%3Aopen+head%3A$branchname"
# Opens the MaMpf GitHub code tree at the current branch in the default browser
code branch="":
#!/usr/bin/env bash
branchname={{ if branch == "" {"$(git branch --show-current)"} else {branch} }}
xdg-open https://github.com/MaMpf-HD/mampf/tree/$branchname
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"shopify.ruby-lsp",
"dbaeumer.vscode-eslint",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-german"
"streetsidesoftware.code-spell-checker-german",
"nefrob.vscode-just-syntax"
]
}
9 changes: 5 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"source.fixAll.eslint": "explicit"
},
"eslint.format.enable": true, // use ESLint as formatter
"eslint.experimental.useFlatConfig": true,
// this disables VSCode built-in formatter (instead we want to use ESLint)
"javascript.validate.enable": false,
"eslint.options": {
Expand Down Expand Up @@ -71,7 +70,8 @@
"node_modules/": true,
"pdfcomprezzor/": true,
"coverage/": true,
"solr/": true
"solr/": true,
".docker/": true
},
"files.associations": {
"*.js.erb": "javascript",
Expand Down Expand Up @@ -104,8 +104,9 @@
//////////////////////////////////////
"cSpell.words": [
"commontator",
"factorybot",
"helpdesk",
"katex",
"turbolinks"
],
"rubyLsp.customRubyCommand": "set -o allexport && . ./docker-dummy.env && set +o allexport"
]
}
Loading

0 comments on commit 50055d1

Please sign in to comment.