Skip to content

Commit

Permalink
Add Makefile to support make checkstyle, make format, `make runTe…
Browse files Browse the repository at this point in the history
…sts` commands
  • Loading branch information
imaNNeo committed Mar 23, 2021
1 parent 9b2814e commit e6fcea1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* [IMPROVEMENT] Added `children` property in the [LineTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/line_chart.md#linetooltipitem), [BarTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/bar_chart.md#bartooltipitem) and [ScatterTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/scatter_chart.md#scattertooltipitem) which accepts a list of [TextSpan](https://api.flutter.dev/flutter/painting/TextSpan-class.html). It allows you to have more customized texts inside the tooltip. See [BarChartSample1](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/bar_chart.md#sample-1-source-code) and [ScatterSample2](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/scatter_chart.md#sample-2-source-code), #72, #294.
* [IMPROVEMENT] Added `getTouchLineStart` and `getTouchLineEnd` in [LineTouchData](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling) to give more customizability over showing the touch lines. see [SampleLineChart9](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/line_chart.md#sample-8-source-code).
* [IMPROVEMENT] Enabled `sectionsSpace` in PieChart for the web.
* [IMPROVEMENT] Added [Makefile](https://makefiletutorial.com) commands which makes it comfortable for verifying your code before push (It is related to contributors, red more about it in [CONTRIBUTING.md](https://github.com/imaNNeoFighT/fl_chart/blob/master/CONTRIBUTING.md)).
* [BUGFIX] Fixed some bugs on drawing PieChart (for example when we have only one section), #582,
* [BREAKING] You cannot set `0` value on [PieChartSectionData](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/pie_chart.md#piechartsectiondata).value anymore, instead remove it from list.
* [BREAKING] Removed `fullHeightTouchLine` property from [LineTouchData](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling). Now you can have a full line with following snippet:
Expand Down
16 changes: 10 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ It makes draw functions testable.
After you have made your changes, you have to make sure your code works
correctly and meets our guidelines. Our guidelines are:

- Make sure the code passes the tests. To run tests, run `flutter test`.
You can simply run `make checkstyle`, and if you faced any formatting problem, run `make format`.

- Make sure to run `flutter analyze` and resolve any warnings or errors.
##### Run `make checkstyle` to ensure that your code is formatted correctly
- It runs `flutter analyze` to verify that there is no any warning or error.
- It runs `flutter format --set-exit-if-changed --dry-run --line-length 100 .` to verify that code has formatted correctly.

- The code should be formatted correctly. For Visual Studio Code users, this is
automatically enforced. Otherwise, you can run this command inside the
project from the command line: `flutter format --line-length 100 .`.
We use `flutter format --set-exit-if-changed --dry-run --line-length 100 .` command in CI.
#### Run `make format` to reformat the code
- It runs `flutter format --line-length 100 .` to format your code with 100 characters limit.


#### Run `make runTests` to ensure that all tests are passing.
- It runs `flutter test` under the hood.

## Creating a Pull Request

Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
checkstyle:
flutter analyze; \
flutter format --set-exit-if-changed --dry-run --line-length 100 .

format:
flutter format --line-length 100 .

runTests:
flutter test

0 comments on commit e6fcea1

Please sign in to comment.