From 4fd54aac5a3ec823855eac451ceacd4a1ff292a1 Mon Sep 17 00:00:00 2001 From: Lam Trinh <> Date: Fri, 2 Aug 2024 17:58:22 +0700 Subject: [PATCH] Update README.md code block format. --- android/README.md | 6 +++--- android/test/e2e/README.md | 10 +++++----- building/README.md | 6 +++--- graphics/README.md | 4 ++-- gui/README.md | 8 ++++---- gui/locales/README.md | 8 ++++---- gui/scripts/README.md | 4 ++-- ios/README.md | 14 +++++++------- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/android/README.md b/android/README.md index d90355374c39..639d09bd76e6 100644 --- a/android/README.md +++ b/android/README.md @@ -22,7 +22,7 @@ structure and can therefore be opened in Android Studio or any other IDE or edit The easiest and recommended way to build the Android project including the `mullvad-daemon` and `wireguard-go` is to use the following command (which requires `podman`): -``` +```bash ../building/containerized-build.sh android --dev-build ``` See the [build instructions](BuildInstructions.md) for further information. @@ -44,12 +44,12 @@ In order to format XML files, the script `scripts/tidy.sh` is used. As the scrip container image is used. Command to format: -``` +```bash scripts/tidy.sh format ``` Command to format and check for any changes: -``` +```bash scripts/tidy.sh formatAndCheckDiff ``` diff --git a/android/test/e2e/README.md b/android/test/e2e/README.md index be41a8334169..1c4cfca875dd 100644 --- a/android/test/e2e/README.md +++ b/android/test/e2e/README.md @@ -5,20 +5,20 @@ The tests in this module are end-to-end tests that rely on the publicly accessib ## How to run the tests ### Locally Set tokens in the below command and then execute the command in the `android` directory to run the tests on a local device: -``` +```bash ./gradlew :test:e2e:connectedDebugAndroidTest \ -Pvalid_test_account_number=XXXX \ -Pinvalid_test_account_number=XXXX ``` For convenience, the tokens can also be set in `/android/local.properties` in the following way: -``` +```properties valid_test_account_number=XXXX invalid_test_account_number=XXXX ``` It's also possible to provide the tokens to the test runner during test execution. However note that this requires [the APKs to be installed manually](https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner#architecture). -``` +```bash adb shell 'CLASSPATH=$(pm path androidx.test.services) app_process / \ androidx.test.services.shellexecutor.ShellMain am instrument -w \ -e clearPackageData true \ @@ -34,7 +34,7 @@ Firebase Test Lab can be used to run the tests on vast collection of physical an 1. Setup the gcloud CLI by following the [official documentation](https://firebase.google.com/docs/test-lab/android/command-line). 2. Set tokens in the below command and then execute the command in the `android` directory to run the tests (on a Pixel 5e): -``` +```bash gcloud firebase test android run \ --type instrumentation \ --app ./android/app/build/outputs/apk/debug/app-debug.apk \ @@ -45,7 +45,7 @@ gcloud firebase test android run \ ``` If using gcloud via the docker image, the following can be executed in the `android` directory to run the tests (on a Pixel 5e): -``` +```bash docker run --rm --volumes-from gcloud-config -v ${PWD}:/android gcr.io/google.com/cloudsdktool/google-cloud-cli gcloud firebase test android run \ --type instrumentation \ --app ./android/app/build/outputs/apk/debug/app-debug.apk \ diff --git a/building/README.md b/building/README.md index 856b18a690a9..a35a2bedcee6 100644 --- a/building/README.md +++ b/building/README.md @@ -9,7 +9,7 @@ the container images to ghcr.io. If you `sudo` into a `build` account that do the builds, you need to set the permissions on the tty, so podman can ask for the passphrase for the gpg key: -``` +```bash realuser@server $ sudo chown build:build $(tty) realuser@server $ sudo -u build -i ``` @@ -28,7 +28,7 @@ https://docs.github.com/en/packages/working-with-a-github-packages-registry/work Build and publish the container image. Tag it with the github hash of the current commit. This also adds the container GPG signatures to the sigstore and commits that to git. The single sigstore addition (signed) commit can be pushed directly to the main branch without PR. -``` +```bash # Builds a new container image, pushes it to the registry, signs it and commits the signatures in git ./build-and-publish-container-image.sh (linux|android) @@ -68,7 +68,7 @@ verification steps](#pulling-verifying-and-using-build-images) with some slight These instructions describe how anyone can pull the images and verify them with GPG before using them. Copy the Mullvad app container signing GPG key to somewhere outside the repository (so a `git pull` can't overwrite it with a malicious key): -``` +```bash cp ${repo}/building/mullvad-app-container-signing.asc /path/to/mullvad-app-container-signing.asc ``` diff --git a/graphics/README.md b/graphics/README.md index 5403476c1445..0969f4e5ab4d 100644 --- a/graphics/README.md +++ b/graphics/README.md @@ -41,14 +41,14 @@ listing. The resulting 512x512 PNG image should be placed in the `android/app/src/main/play/listings/en-US/graphics/icon/` directory. The file can be generate with the following command: -``` +```bash rsvg-convert ./icon-square.svg -w 512 -h 512 -o ../android/app/src/main/play/listings/en-US/graphics/icon/icon.png ``` #### iOS `icon-square.svg` is used to generate the app icon for iOS. To regenerate the assets run: -``` +```bash ios/convert-assets.rb --app-icon ``` diff --git a/gui/README.md b/gui/README.md index 224f8ed54fe8..87a3152ee5a2 100644 --- a/gui/README.md +++ b/gui/README.md @@ -24,17 +24,17 @@ The app has unit tests and integration tests located in test/: The tests in **test/e2e/installed** are run against the already installed app using the currently running daemon. It's possible to run these tests on any machine with the app installed by running -``` +```bash npm run e2e:sequential installed/ ``` or without building by running -``` +```bash npm run e2e:sequential:no-build installed/ ``` It is also possible to build these tests along with all its dependencies into an executable that can be run on any computer that has the app installed. The command for building the test executable is: -``` +```bash npm run build-test-executable ``` The executable for all platforms are outputted to `/dist/`. @@ -43,7 +43,7 @@ The build is configured in `standalone-tests.ts` The artifact can be run by either calling without arguments or with specific tests. A lot of the tests are depending on the daemon already being in a specific state and will fail if it's not. -``` +```bash ./mullvadvpn-app-e2e-tests-linux state-dependent/location.spec ``` diff --git a/gui/locales/README.md b/gui/locales/README.md index a4713e3ac1b3..af146bf8bf47 100644 --- a/gui/locales/README.md +++ b/gui/locales/README.md @@ -28,7 +28,7 @@ This is a folder with gettext translations for Mullvad VPN app. 1. ZIP file with the following command: - ``` + ```bash cd gui/locales zip payload.zip /relay-locations.po ``` @@ -42,7 +42,7 @@ This is a folder with gettext translations for Mullvad VPN app. Use the localization script to sync localizations by running the following command from the root-directory: -``` +```bash ./scripts/localization sync-local-files ``` @@ -53,7 +53,7 @@ all local files are in sync. Use the localization script to prepare the pot-files by running the following command from the root-directory: -``` +```bash ./scripts/localization prepare ``` @@ -80,7 +80,7 @@ CROWDIN_API_KEY=$YOUR_CROWDIN_KEY `./scripts/localization download` Use the localization script to verify that the strings are valid HTML and that they contain the correct amount of format specifiers: -``` +```bash ./scripts/localization verify ``` diff --git a/gui/scripts/README.md b/gui/scripts/README.md index 8556bb85fbd7..ceaf69f9f67b 100644 --- a/gui/scripts/README.md +++ b/gui/scripts/README.md @@ -27,7 +27,7 @@ and `integrate-relay-locations.py` in this directory. 1. Freeze dependencies: -``` +```bash pip3 freeze -r requirements.txt ``` @@ -36,6 +36,6 @@ and save the output into `requirements.txt`. 2. Hash them with `hashin` tool: -``` +```bash hashin --python 3.7 --verbose --update-all ``` diff --git a/ios/README.md b/ios/README.md index 63ce6c7542e5..73f93690e50d 100644 --- a/ios/README.md +++ b/ios/README.md @@ -17,20 +17,20 @@ instructions document. The codebase is formatted using [SwiftFormat](https://github.com/nicklockwood/SwiftFormat). Please format all contributions using the latest version of formatter. -``` +```bash swiftformat ios/ ``` Install the latest version of SwiftFormat via Homebrew: -``` +```bash brew install swiftformat ``` CI uses the latest version available on Homebrew to check formatting, so please keep your local installation up to date, if you see it complain: -``` +```bash brew upgrade swiftformat ``` @@ -46,13 +46,13 @@ configuration. 1. Create the build configuration using a template file: - ``` + ```bash cp ios/Configurations/Screenshots.xcconfig.template ios/Configurations/Screenshots.xcconfig ``` 1. Edit the configuration file and put your account number without quotes: - ``` + ```bash vim ios/Configurations/Screenshots.xcconfig ``` @@ -62,7 +62,7 @@ configuration. 1. Install Ruby 2.5.1 or later using `rvm install `. 1. Install necessary third-party ruby gems: - ``` + ```bash cd ios bundle install ``` @@ -71,7 +71,7 @@ configuration. Run the following command to take screenshots: -``` +```bash cd ios bundle exec fastlane snapshot ```