Commit Checks

When commit checks are enabled, P42 analyzes and verifies code changes in the repository whenever:

  • Pull requests are opened, or
  • Commits are made to the default branch of the GitHub repository.

Pull Request Checks

If the commit checks setting is enabled for a type of analysis (e.g. Use Arrow Functions), P42 performs code analysis whenever pull requests (that are not opened by the P42 app) are made to the repository.

๐Ÿ“ย ย P42 checks are only performed on files that are included in the commit for a pull request.

To check the status for pull request checks:

  1. Navigate to the pull request page for your GitHub repository. For example, go to https://github.com/UserA/sample-repository-1/pulls.
  2. Click on the check status indicator next to your pull request title.
    GitHub pull request check status indicator
  3. In the commit checks summary, click on Details to view the check details page for more information on each P42 analysis check.
    List of enabled commit checks for the pull request

Default Branch Checks

If the commit checks setting is enabled for a type of analysis (e.g. Use Arrow Functions), P42 performs the code analysis whenever commits are made to the default branch of the repository.

๐Ÿ“ย ย P42 checks are only performed on files that are included in the commit.

To check the status for commit checks:

  1. Navigate to your GitHub repository. For example, go to https://github.com/UserA/sample-repository-1.
  2. Click on the check status indicator next to your commit hash. You should see a summary of commit checks that are enabled for the repository.
    GitHub check status indicator
  3. In the commit checks summary, click on Details to view the checks details page for more information on each P42 analysis check.
    List of enabled commit checks

Check Details

You can find the following information in the GitHub checks page for your repository:

GitHub check runs page

  1. List of P42 checks
    The list of P42 analysis types where the commit checks is enabled. Clicking on a type of analysis displays the details in the right pane.

  2. Re-run check
    It may be useful to re-run checks that failed or contained errors when any repository settings are changed. For example, if P42 suggestions are newly excluded or re-included, or if path exclusions are updated.

  3. Analysis type
    Type of P42 analysis.

  4. Analysis summary
    This section provides a brief description of the analysis, and the type of refactoring or code modernization approach supported by P42.

  5. Suggestions
    This section lists all files in the commit which failed the P42 commit check, and provides a simplified diff view on the P42-suggested changes for each file.

Quick Navigation