Skip to content

Commit

Permalink
retired Haxe 3 compilation support (#502)
Browse files Browse the repository at this point in the history
* retired Haxe 3 compilation support
* updated haxeparser, tokentree, json2object and munit libs
  • Loading branch information
AlexHaxe authored Dec 20, 2020
1 parent 1a13453 commit 75ccc4a
Show file tree
Hide file tree
Showing 156 changed files with 215 additions and 535 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/checkstyle-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
haxe-version: ['3.4.7', '4.0.5', '4.1.2']
haxe-version: ['4.0.5', '4.1.4', 'nightly']
env:
CC_TEST_REPORTER_ID: 1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
Expand All @@ -26,7 +26,7 @@ jobs:
with:
node-version: 10
- name: Installing codeclimate client
if: matrix.haxe-version == '4.1.2'
if: matrix.haxe-version == '4.1.4'
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
Expand All @@ -37,11 +37,6 @@ jobs:
run: |
npx lix download haxe ${{ matrix.haxe-version }}
npx lix use haxe ${{ matrix.haxe-version }}
- name: Prepare Haxe 3 dependencies
if: matrix.haxe-version == '3.4.7'
run: |
mv haxe_libraries haxe4_libraries
mv haxe3_libraries haxe_libraries
- name: Run lix download
run: npx lix download
- name: Print versions
Expand All @@ -60,25 +55,18 @@ jobs:
run: echo "y" | npx haxe buildCpp.hxml
- name: Build JSON schema
run: npx haxe buildSchema.hxml
- name: Run neko tests
if: matrix.haxe-version == '3.4.7'
run: npx haxe -D codecov_json testAndResources.hxml
- name: Run eval tests
if: matrix.haxe-version != '3.4.7'
run: npx haxe -D codecov_json testAndResources.hxml
- name: Run Java tests
run: npx haxe testJava.hxml
- name: Run Jvm tests
if: matrix.haxe-version != '3.4.7'
run: npx haxe testJvm.hxml
- name: Format and upload codeclimate coverage
if: success() && matrix.haxe-version == '4.1.2'
if: success() && matrix.haxe-version == '4.1.4'
run: |
( \
cd src; \
../cc-test-reporter format-coverage -t lcov ../lcov.info; \
../cc-test-reporter upload-coverage; \
)
- name: Upload results to codecov
if: success() && (matrix.haxe-version == '3.4.7' || matrix.haxe-version == '4.1.2')
if: success() && (matrix.haxe-version == '4.1.4')
run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
2 changes: 1 addition & 1 deletion .haxerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.1.2",
"version": "4.1.4",
"resolveLibs": "scoped"
}
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ env:
global:
- CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7
matrix:
- HAXE_VERSION=haxe347
- HAXE_VERSION=haxe4
- HAXE_VERSION=haxe41
- HAXE_VERSION=nightly

install:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter
- npm install
- if [[ "$HAXE_VERSION" == "haxe347" ]]; then mv haxe_libraries haxe4_libraries; mv haxe3_libraries haxe_libraries; fi
- if [[ "$HAXE_VERSION" == "haxe347" ]]; then npx lix download haxe 3.4.7; npx lix use haxe 3.4.7; fi
- if [[ "$HAXE_VERSION" == "haxe4" ]]; then npx lix download haxe 4.0.5; npx lix use haxe 4.0.5; fi
- if [[ "$HAXE_VERSION" == "haxe41" ]]; then npx lix download haxe 4.1.2; npx lix use haxe 4.1.2; fi
- if [[ "$HAXE_VERSION" == "haxe41" ]]; then npx lix download haxe 4.1.4; npx lix use haxe 4.1.4; fi
- if [[ "$HAXE_VERSION" == "nightly" ]]; then npx lix download haxe nightly; npx lix use haxe nightly; fi
- npx lix download
- npx haxe -version
Expand All @@ -37,7 +34,6 @@ script:
- npx haxe buildSchema.hxml
- npx haxe -D codecov_json testAndResources.hxml
- npx haxe testJava.hxml
- if [[ "$HAXE_VERSION" != "haxe347" ]]; then npx haxe testJvm.hxml; fi
- (cd src; ../cc-test-reporter format-coverage -t lcov ../lcov.info)

after_script:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- Fixed handling `OBJECT_DECL` token in `RightCurly`, fixes [#496](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/496) ([#497](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/497))
- Reorganised build files ([#498](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/498))
- Refactored for tokentree API change ([#500](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/500) + [#501](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/501))
- Updated haxeparser lib with latest syntax changes ([#502](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/502))
- Retired Haxe 3.4.7 compile support ([#502](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/502))

## version 2.6.1 (2019-12-17)

Expand Down
2 changes: 0 additions & 2 deletions build/Build.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class Build {
callLix("buildSchema.hxml", "Json schema");
callLix("testAndResources.hxml", "Unittests neko / eval + generate resoucres");
callLix("testJava.hxml", "Unittests Java");
#if haxe4
callLix("testJvm.hxml", "Unittests Jvm");
#end
Sys.exit(exitCode);
}

Expand Down
4 changes: 3 additions & 1 deletion buildJS.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
build/common.hxml
-lib hxnodejs
-main checkstyle.Main
-js haxecheckstyle.js
-js haxecheckstyle.js

-cmd mkdir -p bin && cp haxecheckstyle.js bin/checkstyle.js
3 changes: 0 additions & 3 deletions haxe3_libraries/compiletime.hxml

This file was deleted.

4 changes: 0 additions & 4 deletions haxe3_libraries/haxeparser.hxml

This file was deleted.

3 changes: 0 additions & 3 deletions haxe3_libraries/hxargs.hxml

This file was deleted.

4 changes: 0 additions & 4 deletions haxe3_libraries/hxcpp.hxml

This file was deleted.

5 changes: 0 additions & 5 deletions haxe3_libraries/hxjava.hxml

This file was deleted.

3 changes: 0 additions & 3 deletions haxe3_libraries/hxjsonast.hxml

This file was deleted.

7 changes: 0 additions & 7 deletions haxe3_libraries/hxnodejs.hxml

This file was deleted.

3 changes: 0 additions & 3 deletions haxe3_libraries/hxparse.hxml

This file was deleted.

4 changes: 0 additions & 4 deletions haxe3_libraries/json2object.hxml

This file was deleted.

3 changes: 0 additions & 3 deletions haxe3_libraries/mconsole.hxml

This file was deleted.

5 changes: 0 additions & 5 deletions haxe3_libraries/mcover.hxml

This file was deleted.

4 changes: 0 additions & 4 deletions haxe3_libraries/mlib.hxml

This file was deleted.

6 changes: 0 additions & 6 deletions haxe3_libraries/munit.hxml

This file was deleted.

5 changes: 0 additions & 5 deletions haxe3_libraries/test-adapter.hxml

This file was deleted.

3 changes: 0 additions & 3 deletions haxe3_libraries/tokentree.hxml

This file was deleted.

4 changes: 2 additions & 2 deletions haxe_libraries/haxeparser.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @install: lix --silent download "gh://github.com/simn/haxeparser#00b509e8690300ca6366aa8d0d4d97bd29fbcf2b" into haxeparser/3.3.0/github/00b509e8690300ca6366aa8d0d4d97bd29fbcf2b
# @install: lix --silent download "gh://github.com/Simn/haxeparser#7649b016b86ff16676110a7cddcbe186a5101ca6" into haxeparser/3.3.0/github/7649b016b86ff16676110a7cddcbe186a5101ca6
-lib hxparse
-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/00b509e8690300ca6366aa8d0d4d97bd29fbcf2b/src
-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/7649b016b86ff16676110a7cddcbe186a5101ca6/src
-D haxeparser=3.3.0
2 changes: 1 addition & 1 deletion haxe_libraries/hxjsonast.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-D hxjsonast=1.0.1
# @install: lix --silent download "haxelib:/hxjsonast#1.0.1" into hxjsonast/1.0.1/haxelib
-cp ${HAXE_LIBCACHE}/hxjsonast/1.0.1/haxelib/src
-D hxjsonast=1.0.1
6 changes: 3 additions & 3 deletions haxe_libraries/hxparse.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-D hxparse=4.0.0
# @install: lix --silent download "gh://github.com/Simn/hxparse#f61faa2021f2abb85360f997ff72c4156c891adc" into hxparse/4.0.0/github/f61faa2021f2abb85360f997ff72c4156c891adc
-cp ${HAXE_LIBCACHE}/hxparse/4.0.0/github/f61faa2021f2abb85360f997ff72c4156c891adc/src
# @install: lix --silent download "gh://github.com/Simn/hxparse#93f67419852e96daa2b81901c43a77e878c8c2bc" into hxparse/4.0.1/github/93f67419852e96daa2b81901c43a77e878c8c2bc
-cp ${HAXE_LIBCACHE}/hxparse/4.0.1/github/93f67419852e96daa2b81901c43a77e878c8c2bc/src
-D hxparse=4.0.1
6 changes: 3 additions & 3 deletions haxe_libraries/json2object.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-D json2object=3.6.4
# @install: lix --silent download "haxelib:/json2object#3.6.4" into json2object/3.6.4/haxelib
# @install: lix --silent download "gh://github.com/elnabo/json2object#a6845b4826151271dd34c69631ffda0886abd562" into json2object/3.8.1/github/a6845b4826151271dd34c69631ffda0886abd562
-lib hxjsonast
-cp ${HAXE_LIBCACHE}/json2object/3.6.4/haxelib/src
-cp ${HAXE_LIBCACHE}/json2object/3.8.1/github/a6845b4826151271dd34c69631ffda0886abd562/src
-D json2object=3.8.1
8 changes: 3 additions & 5 deletions haxe_libraries/munit.hxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# @install: lix --silent download "haxelib:/munit#2.3.4" into munit/2.3.4/haxelib
# @run: haxelib run-dir munit ${HAXE_LIBCACHE}/munit/2.3.4/haxelib
-lib mcover
# @install: lix --silent download "gh://github.com/AlexHaxe/MassiveUnit#645952947a10d27f2460321eb9c6c9e2a93b997d" into MassiveUnit/0.0.0/github/645952947a10d27f2460321eb9c6c9e2a93b997d
-lib mlib
-cp ${HAXE_LIBCACHE}/munit/2.3.4/haxelib/
-D munit=2.3.4
-cp ${HAXE_LIBCACHE}/MassiveUnit/0.0.0/github/645952947a10d27f2460321eb9c6c9e2a93b997d/src
-D munit=2.3.5
6 changes: 3 additions & 3 deletions haxe_libraries/tokentree.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "gh://github.com/HaxeCheckstyle/tokentree#afc7afd91b15758c871bd59b6ebdf7916a400f7f" into tokentree/1.0.28/github/afc7afd91b15758c871bd59b6ebdf7916a400f7f
-cp ${HAXE_LIBCACHE}/tokentree/1.0.28/github/afc7afd91b15758c871bd59b6ebdf7916a400f7f/src
-D tokentree=1.0.28
# @install: lix --silent download "gh://github.com/HaxeCheckstyle/tokentree#8d317ea6b0c472234c154ce21ec92f2cf1629d3e" into tokentree/1.0.31/github/8d317ea6b0c472234c154ce21ec92f2cf1629d3e
-cp ${HAXE_LIBCACHE}/tokentree/1.0.31/github/8d317ea6b0c472234c154ce21ec92f2cf1629d3e/src
-D tokentree=1.0.31
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "haxe-checkstyle",
"name": "@haxecheckstyle/haxe-checkstyle",
"version": "2.6.1",
"description": "Automated code analysis ideal for projects that want to enforce a coding standard.",
"repository": {
"type": "git",
"url": "https://github.com/HaxeCheckstyle/haxe-checkstyle"
"url": "git+https://github.com/HaxeCheckstyle/haxe-checkstyle"
},
"keywords": [
"checkstyle",
Expand Down Expand Up @@ -32,5 +32,17 @@
"lix": "^15.9.0"
},
"bugs": "https://github.com/HaxeCheckstyle/haxe-checkstyle/issues",
"license": "MIT"
"license": "MIT",
"bin": {
"haxe-checkstyle": "bin/checkstyle.js"
},
"files": [
"bin"
],
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"scripts": {
"build": "haxe buildAll.hxml"
}
}
4 changes: 3 additions & 1 deletion resources/checkstyle-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@
"MACRO",
"DYNAMIC",
"EXTERN",
"FINAL"
"FINAL",
"ABSTRACT",
"OVERLOAD"
]
},
"type": "array",
Expand Down
9 changes: 1 addition & 8 deletions schema/DollarName.hx
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
#if haxe4
enum abstract DollarName(String) to String {
var DollarSchema = "$schema";
var DollarRef = "$ref";
}
#else
@:enum abstract DollarName(String) to String {
var DollarSchema = "@$__hx__$schema";
var DollarRef = "@$__hx__$ref";
}
#end
}
12 changes: 1 addition & 11 deletions src/checkstyle/CheckerThread.hx
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
package checkstyle;

#if ((haxe_ver >= 4.0) && (neko || macro || eval || cpp || hl || java))
import sys.thread.Thread;
#elseif neko
import neko.vm.Thread;
#elseif cpp
import cpp.vm.Thread;
#elseif java
import java.vm.Thread;
#else
import checkstyle.utils.Thread;
#end
import checkstyle.checks.Check;
import checkstyle.config.ExcludeManager;
import checkstyle.reporter.ReporterManager;
import checkstyle.utils.Thread;

class CheckerThread {
static inline var SLEEP_TIME:Float = 0.1;
Expand Down
3 changes: 1 addition & 2 deletions src/checkstyle/SeverityLevel.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ package checkstyle;
- WARNING = all violations have warning / medium priority
- ERROR = all violations have error / highest priority
**/
@:enum
abstract SeverityLevel(String) from String {
enum abstract SeverityLevel(String) from String {
var INFO = "INFO";
var WARNING = "WARNING";
var ERROR = "ERROR";
Expand Down
3 changes: 1 addition & 2 deletions src/checkstyle/checks/Category.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package checkstyle.checks;

@:enum
abstract Category(String) {
enum abstract Category(String) {
var BUG_RISK = "Bug Risk";
var CLARITY = "Clarity";
var COMPLEXITY = "Complexity";
Expand Down
3 changes: 1 addition & 2 deletions src/checkstyle/checks/block/ConditionalCompilationCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ class ConditionalCompilationCheck extends Check {
- startOfLine = #if, #else, #elseif and #end must start at beginning of line
- aligned = indentation of #if, #else, #elseif and #end must match surrounding code
**/
@:enum
abstract ConditionalCompilationPolicy(String) {
enum abstract ConditionalCompilationPolicy(String) {
var START_OF_LINE = "startOfLine";
var ALIGNED = "aligned";
}
6 changes: 2 additions & 4 deletions src/checkstyle/checks/block/EmptyBlockCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ class EmptyBlockCheck extends Check {
}
}

@:enum
abstract EmptyBlockCheckToken(String) {
enum abstract EmptyBlockCheckToken(String) {
var CLASS_DEF = "CLASS_DEF";
var ENUM_DEF = "ENUM_DEF";
var ABSTRACT_DEF = "ABSTRACT_DEF";
Expand All @@ -201,8 +200,7 @@ abstract EmptyBlockCheckToken(String) {
var REIFICATION = "REIFICATION";
}

@:enum
abstract EmptyBlockCheckOption(String) {
enum abstract EmptyBlockCheckOption(String) {
// allow empty blocks but enforce "{}" notation
var EMPTY = "empty";
// empty blocks must contain something apart from whitespace (comment or statement)
Expand Down
Loading

0 comments on commit 75ccc4a

Please sign in to comment.