Skip to content

Commit 380a57d

Browse files
authored
changed messages for Final and ModifierOrder checks (#493)
* changed messages for Final and ModifierOrder checks * prepare 2.6.1
1 parent b1fa854 commit 380a57d

File tree

13 files changed

+78
-40
lines changed

13 files changed

+78
-40
lines changed

.github/workflows/checkstyle-linux.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
haxe-version: ['3.4.7', '4.0.3', 'nightly']
18+
haxe-version: ['3.4.7', '4.0.5', 'nightly']
1919
env:
2020
CC_TEST_REPORTER_ID: 1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7
2121
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
node-version: 10
2828
- name: Installing codeclimate client
29-
if: matrix.haxe-version == '4.0.3'
29+
if: matrix.haxe-version == '4.0.5'
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
@@ -68,13 +68,13 @@ jobs:
6868
- name: Run Java tests
6969
run: npx haxe testJava.hxml
7070
- name: Format and upload codeclimate coverage
71-
if: success() && matrix.haxe-version == '4.0.3'
71+
if: success() && matrix.haxe-version == '4.0.5'
7272
run: |
7373
( \
7474
cd src; \
7575
../cc-test-reporter format-coverage -t lcov ../lcov.info; \
7676
../cc-test-reporter upload-coverage; \
7777
)
7878
- name: Upload results to codecov
79-
if: success() && matrix.haxe-version == '4.0.3'
79+
if: success() && matrix.haxe-version == '4.0.5'
8080
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.0.3",
2+
"version": "4.0.5",
33
"resolveLibs": "scoped"
44
}

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ install:
1717
- npm install
1818
- if [[ "$HAXE_VERSION" == "haxe347" ]]; then mv haxe_libraries haxe4_libraries; mv haxe3_libraries haxe_libraries; fi
1919
- if [[ "$HAXE_VERSION" == "haxe347" ]]; then npx lix download haxe 3.4.7; npx lix use haxe 3.4.7; fi
20-
- if [[ "$HAXE_VERSION" == "haxe4" ]]; then npx lix download haxe 4.0.3; npx lix use haxe 4.0.3; fi
20+
- if [[ "$HAXE_VERSION" == "haxe4" ]]; then npx lix download haxe 4.0.5; npx lix use haxe 4.0.5; fi
2121
- if [[ "$HAXE_VERSION" == "nightly" ]]; then npx lix download haxe nightly; npx lix use haxe nightly; fi
2222
- npx lix download
2323
- npx haxe -version

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

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

5+
## version 2.6.1 (2019-12-17)
6+
57
- Added `allowFinal` setting to `VariableInitialisation`, fixes [#491](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/491) ([#492](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/492))
8+
- Changed message of `Final` check when detecting `public static var` ([#493](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/493))
9+
- Changed message of `ModifierOrder` check to include actual and expected modifier order
610

711
## version 2.6.0 (2019-12-01)
812

haxe3_libraries/test-adapter.hxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
-D test-adapter=1.2.5
2-
# @install: lix --silent download "haxelib:/test-adapter#1.2.5" into test-adapter/1.2.5/haxelib
1+
-D test-adapter=1.2.6
2+
# @install: lix --silent download "haxelib:/test-adapter#1.2.6" into test-adapter/1.2.6/haxelib
33
-lib json2object
4-
-cp ${HAXE_LIBCACHE}/test-adapter/1.2.5/haxelib/
4+
-cp ${HAXE_LIBCACHE}/test-adapter/1.2.6/haxelib/
55
--macro _testadapter.Macro.init()

haxe_libraries/test-adapter.hxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
-D test-adapter=1.2.5
2-
# @install: lix --silent download "haxelib:/test-adapter#1.2.5" into test-adapter/1.2.5/haxelib
1+
-D test-adapter=1.2.6
2+
# @install: lix --silent download "haxelib:/test-adapter#1.2.6" into test-adapter/1.2.6/haxelib
33
-lib json2object
4-
-cp ${HAXE_LIBCACHE}/test-adapter/1.2.5/haxelib/
4+
-cp ${HAXE_LIBCACHE}/test-adapter/1.2.6/haxelib/
55
--macro _testadapter.Macro.init()

makeReleaseZip.sh

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

33
npm install
44
npx lix download
5-
npx lix use haxe 4.0.3
5+
npx lix use haxe 4.0.5
66

77
npx haxe buildAll.hxml
88

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "haxe-checkstyle",
3-
"version": "2.6.0",
3+
"version": "2.6.1",
44
"description": "Automated code analysis ideal for projects that want to enforce a coding standard.",
55
"repository": {
66
"type": "git",

src/checkstyle/checks/modifier/FinalCheck.hx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,22 @@ class FinalCheck extends Check {
2727
}
2828
if (f.access.contains(AFinal)) return;
2929

30-
checkPublicStatic(f);
31-
checkInlineVar(f);
30+
if (checkInlineVar(f)) {
31+
logPos('Consider using "inline final" for field "${f.name}"', f.pos, USE_INLINE_FINAL);
32+
return;
33+
}
34+
if (checkPublicStatic(f)) {
35+
logPos('Consider making public static field "${f.name}" "final" or "private"', f.pos, SHOULD_BE_PUBLIC_FINAL);
36+
return;
37+
}
3238
}
3339

34-
function checkPublicStatic(f:Field) {
35-
if (!f.access.contains(APublic)) return;
36-
if (!f.access.contains(AStatic)) return;
37-
38-
logPos('Public static field "${f.name}" should be "final"', f.pos, SHOULD_BE_PUBLIC_FINAL);
40+
function checkPublicStatic(f:Field):Bool {
41+
return (f.access.contains(APublic)) && (f.access.contains(AStatic));
3942
}
4043

41-
function checkInlineVar(f:Field) {
42-
if (!f.access.contains(AInline)) return;
43-
logPos('Consider using "inline final" for field "${f.name}"', f.pos, USE_INLINE_FINAL);
44+
function checkInlineVar(f:Field):Bool {
45+
return (f.access.contains(AInline));
4446
}
4547

4648
override public function detectableInstances():DetectableInstances {

0 commit comments

Comments
 (0)