Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run perlcritic under CI #580

Closed
wants to merge 11 commits into from
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ all active bug IDs, along with the bug report ID and bug report URL for each.
|-----------------------|-------------------------------------------------------------------------------------|
| bug.id | Assigned bug IDs (included in all results) |
| project.id | Assigned project ID |
| project.name | Original project name |
| project.name | Original project name |
| project.build.file | Location of the Defects4J build file for the project |
| project.vcs | Version control system used by the project |
| project.repository | Location of the project repository |
Expand All @@ -224,15 +224,23 @@ all active bug IDs, along with the bug report ID and bug report URL for each.
| classes.relevant.src | Source classes loaded by the JVM when executing all triggering tests |
| classes.relevant.test | Test classes loaded by the JVM when executing all triggering tests |
| tests.relevant | List of relevant tests classes (a test class is relevant if, when executed, the JVM loads at least one of the modified classes) |
| tests.trigger | List of test methods that trigger (expose) the bug |
| tests.trigger.cause | List of test methods that trigger (expose) the bug, along with the root cause |
| tests.trigger | List of test methods that trigger (expose) the bug, separated by semicolons (`;`) |
| tests.trigger.cause | List of test methods that trigger (expose) the bug, along with the exception thrown. Each list element has the form "methodName --> exceptionClass[: message]", and list elements are separated by semicolons (`;`) |
| deprecated.version | (for deprecated bugs only) Version of Defects4J where a bug was deprecated |
| deprecated.reason | (for deprecated bugs only) Reason for deprecation |

By default, `defects4j query` returns information on active bugs. The `[-D]`
flag returns information only on deprecated bugs, while the `[-A]` flag returns
information for all active and deprecated bugs.

To determine the methods that are changed between the buggy and fixed version of the code:

1. Add this line to your user-level git attributes file:
`*.java diff=java`

2. Run `git diff --no-index`, for example `git diff --no-index /tmp/lang_1_buggy /tmp/lang_1_fixed`.
In the output, every line starting with "@" gives the method name of a changed method.


Test execution framework
--------------------------
Expand Down
1 change: 1 addition & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ requires 'DBI', '>= 1.63';
requires 'JSON', '>= 2.97';
requires 'JSON::Parse', '>= 0.55';
requires 'List::Util', '>= 1.33';
requires 'Perl::Critic';
requires 'String::Interpolate', '>= 0.33';
requires 'URI', '>= 1.72';
7 changes: 6 additions & 1 deletion framework/test/test_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ TOPLEVEL="$(git rev-parse --show-toplevel)"

cd "$TOPLEVEL" || (echo "Cannot cd to $TOPLEVEL" && exit 1)

# Check style of Perl scripts
find . \( -name '*.pm' -o -name '*.pl' \) -print0 | xargs -0 -n1 perl -Mstrict -Mdiagnostics -cw
perlcritic "$TOPLEVEL"/framework
# Don't run perltidy yet.
# find . \( -name '*.pm' -o -name '*.pl' \) -print0 | xargs -0 perltidy -b

# Check style of sh scripts.
grep -r -l '^\#! \?\(/bin/\|/usr/bin/env \)sh' --exclude=\*~ "$TOPLEVEL"/framework | while read -r line
do
Expand All @@ -19,4 +25,3 @@ done
for file in "$TOPLEVEL"/init.sh "$TOPLEVEL"/framework/lib/test_generation/bin/_tool.source ; do
shellcheck -x -P SCRIPTDIR --format=gcc "$file"
done

Loading