This command will take a look at PHP pattern 1 and tries to repair it, --skip-readme tells the tool to skip generating a new README file for that pattern.
Repair a pattern means:
make sure, a pattern JSON file exists
ensure all relative links are correct
collect all instances within the pattern path (an instance is identified by a directory, that contains a JSON file in the instance format)
make sure the pattern name is correct (therefor the pattern name is derived from the directory name)
check the description field and warn if there is no description
check the given tags
validates the pattern json against the pattern json scheme
for each instance, repairing means:
ensuring a instance JSON file with the required keys is available
ensures all relative links exist
check the scala rule if exists and iff necessary adjust the variable names
check the description and again warn if there is no description provided
checks that the field expectation:expectation is the opposite of properties:negative_test_case
validates the instance json against the instance json scheme
for PHP patterns:
generates new opcode for each php file
changes source line and sink line in the pattern JSON
At the moment this feature is only supported for PHP patterns, the feature was developed as part of reviewing all PHP patterns.
This PR aims to change the role of the Pattern and Instance class in the framework a little bit. It enables the possibility, to consider the pattern and the instance without handling the filesystem paths. i.e. the Instance object saves all the paths from the instance JSON as relative paths to a base path. This should make it possible to simplify some of the file system operations.
I would suggest merging this PR after the CPG only feature, as I expect a few merge conflicts
This PR should introduce a new feature for the framework, that can help you reviewing your patterns in your library. Simple usage example:
tpframework patternrepair -l php -p 1 --skip-readme
This command will take a look at PHP pattern 1 and tries to repair it,
--skip-readme
tells the tool to skip generating a new README file for that pattern. Repair a pattern means:expectation:expectation
is the opposite ofproperties:negative_test_case
At the moment this feature is only supported for PHP patterns, the feature was developed as part of reviewing all PHP patterns. This PR aims to change the role of the
Pattern
andInstance
class in the framework a little bit. It enables the possibility, to consider the pattern and the instance without handling the filesystem paths. i.e. theInstance
object saves all the paths from the instance JSON as relative paths to a base path. This should make it possible to simplify some of the file system operations.I would suggest merging this PR after the CPG only feature, as I expect a few merge conflicts