runChecks
Description
runs checks on the specified project. The checks detect problems with the project
integrity such as missing files, unsaved files, files not under source control, or
out-of-date derived files.checkResults
= runChecks(proj
)
You must update the project dependencies if you want to check derived files are up
to date. This can be time-consuming for larger projects. To exclude the derived
files check do not update dependencies before calling
runChecks
.
Examples
Exclude Derived Files Check and Run Project Checks
Open the Times Table App project. Use currentProject
to create a project object from the currently loaded project.
openExample("matlab/TimesTableProjectExample")
proj = currentProject;
For large projects, run all the project checks except the derived files check, as it can be time-consuming.
checkResults = runChecks(proj)
checkResults = 11×1 ProjectCheckResult array with properties: ID Description Passed ProblemFiles
Create a table from the checkResults
array. The table
shows that the derived files check did not run.
summary = table(checkResults)
summary = 11×3 table Passed Description ID ______ ____________________________________________________________________________________________________________________________________ ________________________________________________________ true "All project definition files are under source control." "Project:Checks:ProjectDefinitionFilesUnderSourceControl" true "All files in the project are under source control." "Project:Checks:AllProjectFilesUnderSourceControl" true "All files under source control are in the project." "Project:Checks:AllFilesUnderSourceControlInProject" true "All project folders exist." "Project:Checks:ProjectFoldersExist" true "All project files exist on the file system." "Project:Checks:ProjectFilesExist" true "All project folders on the MATLAB search path are on the project path." "Project:Checks:ProjectPath" true "All projects in sub-folders are referenced by this project." "Project:Checks:ReferencedSubprojects" true "Check for project files with unsaved changes." "Project:Checks:UnsavedProjectFiles" false "All derived files in the project are up-to-date." "Project:Checks:OutOfDateDerivedFiles" true "There are no slprj or sfprj folders in the project." "Project:Checks:SLPRJ" true "Model files saved in a different format (MDL or SLX) are added to the project.↵The original files are not currently in the project." "Project:Checks:MDLToSLX"
Note
Running source control related checks requires a full clone of the
repository. In a CI/CD pipeline, some repository hosting platforms such
as GitLab® default to a shallow clone with a depth of
50
per job. Set the clone and fetch depth to
0
to create a full clone instead.
Run All the Project Checks
Open the Times Table App project. Use currentProject
to create a project object from the currently loaded project.
openExample("matlab/TimesTableProjectExample")
proj = currentProject;
You must first update the project dependencies if you want to check derived files are up to date.
updateDependencies(proj);
Run all the project checks.
checkResults = runChecks(proj)
checkResults = 11×1 ProjectCheckResult array with properties: ID Description Passed ProblemFiles
Note
Running source control related checks requires a full clone of the
repository. In a CI CD pipeline, some repository hosting platforms such
as GitLab, default to a shallow clone with a depth of
50
per job. Set the clone and fetch depth to
0
to create a full clone instead.
Use the ID
, Passed
, and
ProblemFiles
properties to get information about the
first check. The first check passed and found no problems. All project
definition files are under source control.
id = checkResults(1).ID status = checkResults(1).Passed problems = checkResults(1).ProblemFiles
id = "Project:Checks:ProjectDefinitionFilesUnderSourceControl" status = logical 1 problems = 0×0 empty string array
The check for derived files passed and detected no problem files. All derived files are up to date.
id = checkResults(9).ID status = checkResults(9).Passed problems = checkResults(1).ProblemFiles
id = "Project:Checks:OutOfDateDerivedFiles" status = logical 1 problems = 0×0 empty string array
Input Arguments
proj
— Project
matlab.project.Project
object
Project, specified as a matlab.project.Project
object.
Use currentProject
to create a project object from the currently
loaded project.
Output Arguments
checkResults
— Project checks
array of ProjectCheckResult
objects
Project checks, returned as an array of
ProjectCheckResult
objects with properties.
Version History
Introduced in R2020a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)