Code Checks - bluecolab/BlueColab_MobileDataViz GitHub Wiki

Checks and Updates

When a PR is opened, several checks run to check the quality of the code:

image

YAML File

See: https://github.com/bluecolab/BlueColab_MobileDataViz/blob/main/.github/workflows/check_build.yml

Preview

A failed test will look like this:

image

Depending on where you navigate from, clicking on the error or click on details will offer the reason for failure and possible fixes.

See: https://github.com/bluecolab/BlueColab_MobileDataViz/actions/runs/16132762583/job/45523127260

Order of Checks

image

Running All Checks Locally

Run the follow command in the aquawatch_mobile_app directory:

npm test

Checks

pr-branch-check

Purpose: The app-build-branch should never be merged into main. The check verifies that the name of the branch isn't app-build-branch.

Local testing: None

Resolution: Please close the PR.


setup

Purpose: Installs dependencies needed for later checks. It does validate to make sure all packages are compatible with each other.

Local testing: Run the follow command in the aquawatch_mobile_app directory:

npm install

Resolution: Please look into the error logs. The most common error is likely when package versions conflict. There is no one solution but experiment with using different versions of the packages. From time to time npm does have errors on their end, check their status site.


lint

Purpose: Checks the code formatting and also statically checks for potential errors.

Local testing: Run the follow command in the aquawatch_mobile_app directory:

npm run lint

Resolution: Please look into the error log after running the above command.

Automatically fixable errors can be fixed with:

npm run format

Here, installing the recommended extensions will help. Going to problem files they may offer suggestions on fixes (hover over errors and click on quick fixes).

Additionally this repo has special config files which will auto-format your code, if you have the extensions installed.


audit

Purpose: Checks dependencies for any known vulnerabilities.

Local testing: Run the follow command in the aquawatch_mobile_app directory:

npm audit

Resolution: Please look into the error log after running the above command. Some errors may be fixed with:

npm audit fix

spellcheck

Purpose: Checks apps for spelling errors.

Local testing: Run the follow command in the aquawatch_mobile_app directory:

npx cspell .

Resolution: Please look into the error log after running the above command.

Here, installing the recommended extensions will help. A blue underline will appear for miss-spelt words. It will offer potential fixes or offer to add the word to config: aquawatch_mobile_app/.cspell.json. You can manually add custom words to that file as well.


expo-doctor

Purpose: This command performs checks and analyzes the project's codebase for common issues in app config and package.json files, dependency compatibility, configuration files, and the overall health of the project. Learn more: Expo Doctor.

Local testing: Run the follow command in the aquawatch_mobile_app directory:

npx expo-doctor

Resolution: Please look into the error log after running the above command. They will offer suggestions on fixes.

Example

Most often ✖ Validate packages against React Native Directory package metadata check may throw errors for new dependencies. To add exceptions modify package.json. Add the package to expo.doctor.reactNativeDirectoryCheck.exclude list.

"expo": {
    "doctor": {
      "reactNativeDirectoryCheck": {
        "exclude": [
          "react-native-element-dropdown",
          "moment",
          "react-native-orientation-locker",
          "moment",
          "react-native-navigation-bar",
          "react-navigation",
          "react-navigation-stack",
          "tailwindcss",
          "luxon",
          ...more packages here..
        ]
      }
    }
  },
⚠️ **GitHub.com Fallback** ⚠️