Skip to content

Commit b5c2bba

Browse files
authored
added related messages for CodeSimilarity check (#506)
* added related messages for CodeSimilarity check
1 parent b1f356d commit b5c2bba

27 files changed

+466
-217
lines changed

.github/workflows/checkstyle-linux.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
haxe-version: ['4.0.5', '4.1.5', 'nightly']
18+
haxe-version: ['4.0.5', '4.1.5', '4.2.1', 'nightly']
1919
env:
20-
CC_TEST_REPORTER_ID: 1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7
21-
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
20+
CC_TEST_REPORTER_ID: c4eda639526d39fbcab7ab9fc68c4046d4e597df56dbcb552b42d27b3580b758
21+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2222
steps:
2323
- uses: actions/checkout@v1
2424
- name: Use Node.js 10
2525
uses: actions/setup-node@v1
2626
with:
2727
node-version: 10
2828
- name: Installing codeclimate client
29-
if: matrix.haxe-version == '4.1.5'
29+
if: matrix.haxe-version == '4.2.1'
3030
run: |
3131
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
3232
chmod +x ./cc-test-reporter
@@ -60,13 +60,13 @@ jobs:
6060
- name: Run Java tests
6161
run: npx haxe testJava.hxml
6262
- name: Format and upload codeclimate coverage
63-
if: success() && matrix.haxe-version == '4.1.5'
63+
if: success() && matrix.haxe-version == '4.2.1'
6464
run: |
6565
( \
6666
cd src; \
6767
../cc-test-reporter format-coverage -t lcov ../lcov.info; \
6868
../cc-test-reporter upload-coverage; \
6969
)
7070
- name: Upload results to codecov
71-
if: success() && (matrix.haxe-version == '4.1.5')
71+
if: success() && (matrix.haxe-version == '4.2.1')
7272
run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"

.haxerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "4.1.5",
2+
"version": "4.2.1",
33
"resolveLibs": "scoped"
44
}

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ sudo: false
55
dist: xenial
66

77
env:
8-
global:
9-
- CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7
108
matrix:
119
- HAXE_VERSION=haxe4
1210
- HAXE_VERSION=haxe41
11+
- HAXE_VERSION=haxe42
1312
- HAXE_VERSION=nightly
1413

1514
install:
1615
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter
1716
- npm install
1817
- if [[ "$HAXE_VERSION" == "haxe4" ]]; then npx lix download haxe 4.0.5; npx lix use haxe 4.0.5; fi
1918
- if [[ "$HAXE_VERSION" == "haxe41" ]]; then npx lix download haxe 4.1.5; npx lix use haxe 4.1.5; fi
19+
- if [[ "$HAXE_VERSION" == "haxe42" ]]; then npx lix download haxe 4.2.1; npx lix use haxe 4.2.1; fi
2020
- if [[ "$HAXE_VERSION" == "nightly" ]]; then npx lix download haxe nightly; npx lix use haxe nightly; fi
2121
- npx lix download
2222
- npx haxe -version
@@ -37,7 +37,7 @@ script:
3737
- (cd src; ../cc-test-reporter format-coverage -t lcov ../lcov.info)
3838

3939
after_script:
40-
- if [[ "$HAXE_VERSION" == "haxe41" ]]; then (cd src; ../cc-test-reporter upload-coverage); fi
40+
- if [[ "$HAXE_VERSION" == "haxe42" ]]; then (cd src; ../cc-test-reporter upload-coverage); fi
4141

4242
after_success:
4343
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## dev branch / next version (2.x.x)
44

5+
- Added related messages to reporters for `CodeSimilarity` check ([#506](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/506))
56
- Fixed Haxe nightly compilation ([#505](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/505))
67
- Updated to Haxe 4.1.5 ([#505](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/505))
78

haxe_libraries/haxeparser.hxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @install: lix --silent download "gh://github.com/Simn/haxeparser#7649b016b86ff16676110a7cddcbe186a5101ca6" into haxeparser/3.3.0/github/7649b016b86ff16676110a7cddcbe186a5101ca6
1+
# @install: lix --silent download "gh://github.com/simn/haxeparser#9eee8e0db1dc628d53334e30ebf08e31cb1c92b9" into haxeparser/3.3.0/github/9eee8e0db1dc628d53334e30ebf08e31cb1c92b9
22
-lib hxparse
3-
-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/7649b016b86ff16676110a7cddcbe186a5101ca6/src
3+
-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/9eee8e0db1dc628d53334e30ebf08e31cb1c92b9/src
44
-D haxeparser=3.3.0

haxe_libraries/hxcpp.hxml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @install: lix --silent download "haxelib:/hxcpp#4.1.1" into hxcpp/4.1.1/haxelib
2-
# @run: haxelib run-dir hxcpp ${HAXE_LIBCACHE}/hxcpp/4.1.1/haxelib
3-
-cp ${HAXE_LIBCACHE}/hxcpp/4.1.1/haxelib/
4-
-D hxcpp=4.1.1
1+
# @install: lix --silent download "haxelib:/hxcpp#4.2.1" into hxcpp/4.2.1/haxelib
2+
# @run: haxelib run-dir hxcpp ${HAXE_LIBCACHE}/hxcpp/4.2.1/haxelib
3+
-cp ${HAXE_LIBCACHE}/hxcpp/4.2.1/haxelib/
4+
-D hxcpp=4.2.1

haxe_libraries/mcover.hxml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# @install: lix --silent download "haxelib:/mcover#2.2.2" into mcover/2.2.2/haxelib
2-
-lib mconsole
3-
-lib munit
4-
-cp ${HAXE_LIBCACHE}/mcover/2.2.2/haxelib/
5-
-D mcover=2.2.2
1+
# @install: lix --silent download "gh://github.com/AlexHaxe/mcover#156776aafafb7eaa2d5f918d783f7a5fc0595b90" into mcover/0.0.0/github/156776aafafb7eaa2d5f918d783f7a5fc0595b90
2+
-cp ${HAXE_LIBCACHE}/mcover/0.0.0/github/156776aafafb7eaa2d5f918d783f7a5fc0595b90/src
3+
-D mcover=0.0.0

src/checkstyle/CheckMessage.hx

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/checkstyle/Checker.hx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package checkstyle;
22

33
import checkstyle.checks.Check;
4+
import checkstyle.checks.coding.CodeSimilarityCheck;
45
import checkstyle.config.ExcludeManager;
56
import checkstyle.config.ExcludeRange;
67
import checkstyle.reporter.ReporterManager;
@@ -175,6 +176,7 @@ class Checker {
175176
advanceFrame = function() hxt.advance_frame();
176177
#end
177178

179+
ReporterManager.INSTANCE.addDelayedMessageCallback(CodeSimilarityCheck.delayedMessagesCallback);
178180
ReporterManager.INSTANCE.start();
179181
for (checkFile in files) {
180182
loadFileContent(checkFile);
@@ -199,7 +201,7 @@ class Checker {
199201

200202
public function createContext(checkFile:CheckFile):Bool {
201203
file = checkFile;
202-
ReporterManager.INSTANCE.fileStart(file);
204+
ReporterManager.INSTANCE.addFile(file);
203205
try {
204206
findLineSeparator();
205207
makeLines();
@@ -234,10 +236,9 @@ class Checker {
234236
}
235237
ReporterManager.INSTANCE.addMessages(messages);
236238
}
237-
ReporterManager.INSTANCE.fileFinish(file);
238239
}
239240

240-
function runCheck(check:Check):Array<CheckMessage> {
241+
function runCheck(check:Check):Array<Message> {
241242
try {
242243
if (ExcludeManager.isExcludedFromCheck(file.name, check.getModuleName())) return [];
243244
return check.run(this);

src/checkstyle/CheckerThread.hx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,9 @@ class CheckerThread {
9191
}
9292
ReporterManager.INSTANCE.addMessages(messages);
9393
}
94-
ReporterManager.INSTANCE.fileFinish(checker.file);
9594
}
9695

97-
function runCheck(check:Check, checker:Checker):Array<CheckMessage> {
96+
function runCheck(check:Check, checker:Checker):Array<Message> {
9897
try {
9998
if (ExcludeManager.isExcludedFromCheck(checker.file.name, check.getModuleName())) return [];
10099
return check.run(checker);

0 commit comments

Comments
 (0)