Skip to content

Commit

Permalink
Implement pull request check on code style (#505)
Browse files Browse the repository at this point in the history
* Implement pull request check on code style

* Enable debug logging

* Explicitly set EDITORCONFIG_FILE_NAME

* Move .ecrc file to .github/linters

* Revert to standard loglevel and do not set EDITORCONFIG_FILE_NAME
  • Loading branch information
Bert-R authored Apr 17, 2023
1 parent ab07e76 commit 08eea07
Show file tree
Hide file tree
Showing 11 changed files with 687 additions and 636 deletions.
1,254 changes: 627 additions & 627 deletions .editorconfig

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions .github/linters/.ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": true,
"NoColor": false,
"Exclude": [
".editorconfig",
".github",
"LICENSE",
"README.md",
"chart",
"docker-compose",
"docs",
"kaas_local_jaas.conf",
"mvnw",
"mvnw.cmd",
"pom.xml",
"src/main/assembly",
"src/main/docker",
"src/main/resources",
"src/test/resources",
"target",
"theme"
],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"IndentSize": true,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"MaxLineLength": true
}
}
12 changes: 10 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Checkout src repo
uses: actions/checkout@v3
- name: Lint code base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_EDITORCONFIG: true
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Introduction

All contributions are more than welcomed. Contributions may close an issue, fix a bug (reported or not reported), add new design blocks, improve the existing code, add new feature, and so on. In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone.

# Coding style

For code contributions, please respect the coding style as documented in [.editorconfig](.editorconfig). We are in the process of setting up automated checks on this.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ To logout, browse to [/logout](http://localhost:8080/logout).
# Contributing Guidelines

All contributions are more than welcomed. Contributions may close an issue, fix a bug (reported or not reported), add new design blocks, improve the existing code, add new feature, and so on. In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone.
See [here](CONTRIBUTING.md).

## Release workflow

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/kafdrop/config/KafkaConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ public void applyCommon(Properties properties) {
properties.putAll(propertyOverrides);
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/kafdrop/controller/BasicErrorController.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ public ModelAndView handleError(HttpServletRequest request) {
final var model = Map.of("error", error);
return new ModelAndView("error", model);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/kafdrop/controller/ConsumerController.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ public String consumerDetail(@PathVariable("groupId") String groupId, Model mode

return consumer.orElseThrow(() -> new ConsumerNotFoundException(groupId));
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/kafdrop/util/KeyFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

public enum KeyFormat {
DEFAULT, AVRO
}
}
2 changes: 1 addition & 1 deletion src/main/java/kafdrop/util/MessageFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

public enum MessageFormat {
DEFAULT, AVRO, PROTOBUF, MSGPACK
}
}
2 changes: 1 addition & 1 deletion src/test/java/kafdrop/model/ConsumerPartitionVOTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ void testGetLag() {
doLagTest(6, 6, 2, 0);
doLagTest(5, 10, -1, 5);
}
}
}

0 comments on commit 08eea07

Please sign in to comment.