Skip to content

Commit 92c89dd

Browse files
authored
fixes #675 add pre-commit hook and apply it (#676)
1 parent 81452e2 commit 92c89dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+197
-196
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ bin/
2020
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2121
hs_err_pid*
2222

23-
**/.DS_Store
23+
**/.DS_Store

.pre-commit-config.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.2.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- repo: https://github.com/networknt/pre-commit-hook-keyword
10+
rev: f17c4de14fc24420f6768c19cad06ba03af06d86
11+
hooks:
12+
- id: keywordscan
13+
args: ["--keywords=c3VubGlmZQ==,Y2liYw==,c3VuIGxpZmU="]
14+
types: ["text"]

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cache:
44
- $HOME/.m2
55
jdk:
66
- openjdk11
7-
7+
88
branches:
99
only:
1010
- master

CONTRIBUTING.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ top of things.
99

1010
## Core vs Modules
1111

12-
New functionality is typically directed toward middleware components to provide
13-
a slimmer Framework Core, reducing its surface area, and to allow greater freedom
14-
for middleware developers and maintainers.
15-
12+
New functionality is typically directed toward middleware components to provide
13+
a slimmer Framework Core, reducing its surface area, and to allow greater freedom
14+
for middleware developers and maintainers.
15+
1616
If you are unsure of whether your contribution should be implemented as a
1717
middleware component or part of Framework Core, you may visit
1818
[Gitter Chat](https://gitter.im/networknt/light-4j) for advice.
@@ -44,7 +44,7 @@ middleware component or part of Framework Core, you may visit
4444
### Documentation
4545

4646
For changes of a trivial nature to comments and documentation, it is not
47-
necessary to create a new issue.
47+
necessary to create a new issue.
4848

4949
### Example
5050

@@ -55,12 +55,12 @@ Adding new examples or enhance examples won't need to create a new issue.
5555

5656
* Push your changes to a topic branch in your fork of the repository.
5757
* Submit a pull request to the repository in the networknt organization.
58-
* The core team looks at Pull Requests on a regular basis and will merge the pull request.
58+
* The core team looks at Pull Requests on a regular basis and will merge the pull request.
5959
* Sometimes, we might need to contact contributor understand the details of the pull request.
6060

6161
# Additional Resources
6262

6363
* [General GitHub documentation](https://help.github.com/)
6464
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
6565
* [Light 4J Document](https://networknt.github.io/light-4j/)
66-
* [Light 4J Gitter](https://gitter.im/networknt/light-4j)
66+
* [Light 4J Gitter](https://gitter.im/networknt/light-4j)

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ A code generator based on [rocker](https://github.com/fizzed/rocker) that can be
1010

1111
[![Build Status](https://travis-ci.org/networknt/light-codegen.svg?branch=master)](https://travis-ci.org/networknt/light-codegen)
1212

13-
The Light platform contains several frameworks to build different styles of APIs or microservices based on the contract specifications. It encourages users to create service contract specification before coding, and it would be nice if we can scaffold a project based on the designed specification. Further, it would be even sweeter if we could utilize the specification during runtime to verify the security and validate input request/out response based on the same specification.
13+
The Light platform contains several frameworks to build different styles of APIs or microservices based on the contract specifications. It encourages users to create service contract specification before coding, and it would be nice if we can scaffold a project based on the designed specification. Further, it would be even sweeter if we could utilize the specification during runtime to verify the security and validate input request/out response based on the same specification.
1414

1515
Before we built our generator, we looked at the open-source community and couldn't find anything suitable for our needs. So we created one over a weekend, and it turned out very successful. If you want to know more about it, please check out the [light-codegen document](https://doc.networknt.com/tool/light-codegen/).
1616

1717
The generator is very easy to use, and there are numeric ways to use it. Command-line, Docker, Scripting, and [Web UI](https://codegen.lightapi.net). To get started, please follow the [getting-started](https://doc.networknt.com/getting-started/light-codegen/).
1818

1919
If you want to know all the options with the light-codegen, you can follow the tutorials for each generator at [light-codegen tutorial](https://doc.networknt.com/tutorial/generator/).
2020

21-
Also, there are so many [other tutorials](https://doc.networknt.com/tutorial/) that are using light-codegen to scaffold projects, and these can be found in the tutorial section.
22-
23-
21+
Also, there are so many [other tutorials](https://doc.networknt.com/tutorial/) that are using light-codegen to scaffold projects, and these can be found in the tutorial section.

codegen-cli/codegen.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (-not (Test-Path $cliJar)) {
99
Exit 1
1010
}
1111

12-
if (-not (Test-Path env:JAVA_HOME)) {
12+
if (-not (Test-Path env:JAVA_HOME)) {
1313
Write-Host "JAVA_HOME is not set."
1414
Exit 1
1515
}

codegen-cli/codegen.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919
if [ ! -f "$CURRENT_DIR/rocker-compiler.conf" ]; then
2020
echo "generate config $CURRENT_DIR/rocker-compiler.conf"
2121

22-
echo "rocker.template.dir=$CURRENT_DIR" > rocker-compiler.conf
22+
echo "rocker.template.dir=$CURRENT_DIR" > rocker-compiler.conf
2323
fi
2424

2525
if [ ! -d "$CURRENT_DIR/target/classes" ]; then

codegen-cli/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<dependency>
7070
<groupId>com.fizzed</groupId>
7171
<artifactId>rocker-compiler</artifactId>
72-
</dependency>
72+
</dependency>
7373
<dependency>
7474
<groupId>com.beust</groupId>
7575
<artifactId>jcommander</artifactId>

codegen-cli/src/main/java/com/networknt/codegen/Cli.java

-1
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,3 @@ public void run(JCommander jCommander) throws Exception {
148148
}
149149

150150
}
151-

0 commit comments

Comments
 (0)