Skip to content

Commit

Permalink
fixed a NPE in tokentree (#584)
Browse files Browse the repository at this point in the history
* fixed a NPE in tokentree
* updated README
  • Loading branch information
AlexHaxe authored Apr 17, 2020
1 parent 0c8e697 commit 6ccc77f
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
*.zip
.haxelib/
out/
node_modules
.DS_Store
node_modules/
log/
dump/
target/
haxe3/
callgrind.*
./debug
lcov.info
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## dev branch / next version (1.x.x)

## version 1.10.2 (2020-04-18)

- Fixed a null pointer exception in tokentree ([#584](https://github.com/HaxeCheckstyle/haxe-formatter/issues/584))

## version 1.10.1 (2020-04-12)

- Fixed broken indentation after case with OpOr pattern, fixes [#576](https://github.com/HaxeCheckstyle/haxe-formatter/issues/576) ([#581](https://github.com/HaxeCheckstyle/haxe-formatter/issues/581))
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Haxelib Version](https://img.shields.io/github/tag/HaxeCheckstyle/haxe-formatter.svg?label=haxelib)](http://lib.haxe.org/p/formatter)
[![Build Status](https://travis-ci.org/HaxeCheckstyle/haxe-formatter.svg?branch=master)](https://travis-ci.org/HaxeCheckstyle/haxe-formatter)
[![Haxe-Formatter Linux](https://github.com/HaxeCheckstyle/haxe-formatter/workflows/Haxe-Formatter%20Linux/badge.svg)](https://github.com/HaxeCheckstyle/haxe-formatter/actions)
[![Haxe-Formatter](https://github.com/HaxeCheckstyle/haxe-formatter/workflows/Haxe-Formatter/badge.svg)](https://github.com/HaxeCheckstyle/haxe-formatter/actions)
[![codecov](https://codecov.io/gh/HaxeCheckstyle/haxe-formatter/branch/master/graph/badge.svg)](https://codecov.io/gh/HaxeCheckstyle/haxe-formatter)
[![Gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/HaxeCheckstyle/haxe-formatter)

Expand Down Expand Up @@ -74,6 +74,8 @@ Sample call: `haxelib run formatter --stdin -s src/Main.hx < /tmp/code.txt > src

Formatter uses `hxformat.json` files for configuration. It searches for a `hxformat.json` file closest to the file being formatted, starting with the file's folder and moving upward all the way to your root folder. A configuration file in a subfolder will always overwrite any settings from a top or higher level folder.

You can test different configuration settings in our [Formatter code samples / playground / documentation](https://haxecheckstyle.github.io/haxe-formatter-docs/#codesamples.CommonSamples.allman_curlies) website.

The VSCode extension comes with a JSON schema providing completion and limited documentation for edition `hxformat.json` files:

![JSON schema for hxformat.json in VSCode](resources/schema.png)
Expand Down
6 changes: 3 additions & 3 deletions haxe3_libraries/tokentree.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "haxelib:/tokentree#1.0.26" into tokentree/1.0.26/haxelib
-cp ${HAXE_LIBCACHE}/tokentree/1.0.26/haxelib/src
-D tokentree=1.0.26
# @install: lix --silent download "haxelib:/tokentree#1.0.27" into tokentree/1.0.27/haxelib
-cp ${HAXE_LIBCACHE}/tokentree/1.0.27/haxelib/src
-D tokentree=1.0.27
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 "haxelib:/tokentree#1.0.26" into tokentree/1.0.26/haxelib
-cp ${HAXE_LIBCACHE}/tokentree/1.0.26/haxelib/src
-D tokentree=1.0.26
# @install: lix --silent download "haxelib:/tokentree#1.0.27" into tokentree/1.0.27/haxelib
-cp ${HAXE_LIBCACHE}/tokentree/1.0.27/haxelib/src
-D tokentree=1.0.27
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"style"
],
"description": "A code formatter for Haxe",
"version": "1.10.1",
"releasenote": "fixed some regressions of 1.10.0 - see CHANGELOG for details.",
"version": "1.10.2",
"releasenote": "fixed a null pointer exception in tokentree - see CHANGELOG for details.",
"contributors": [
"AlexHaxe",
"Gama11"
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haxe-formatter",
"version": "1.10.1",
"version": "1.10.2",
"description": "A code formatter for Haxe",
"repository": {
"type": "git",
Expand Down
1 change: 0 additions & 1 deletion src/formatter/marker/Indenter.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package formatter.marker;

import formatter.config.Config;
import formatter.config.IndentationConfig;
#if debugIndent
import sys.io.File;
Expand Down
20 changes: 20 additions & 0 deletions test/testcases/other/private_final_class.hxtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"emptyLines": {
"maxAnywhereInFile": 0
}
}

---

package;
private final class Test {
public function new() {
}
}

---

package;
private final class Test {
public function new() {}
}

0 comments on commit 6ccc77f

Please sign in to comment.