Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Keep Spotless formatting stable across operating systems.
*.java text eol=lf
25 changes: 25 additions & 0 deletions .github/workflows/check_java_formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Check Java Formatting"

on:
push:
branches:
- master
- develop
- release
pull_request:

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
cache: maven
- name: Check Java formatting
run: mvn -B -ntp spotless:check
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,31 @@ configurations, such as:

## Development

### Java formatting

The checked-in `conquery_eclipse_format_setting.xml` is the canonical Java formatter configuration. Spotless also
organizes imports with static imports first. Wildcard imports are currently allowed. Run Spotless from the repository
root:

```bash
mvn spotless:apply
mvn spotless:check
```

Install the repository's pre-push formatting check once per clone:

```bash
mvn spotless:install-git-pre-push-hook
```

The hook formats violations and aborts the push so the resulting changes can be reviewed and committed. It is a local
convenience and can be bypassed; CI remains the authoritative formatting check.

IntelliJ IDEA does not automatically import an Eclipse formatter profile from the project root. Import
`conquery_eclipse_format_setting.xml` under **Editor | Code Style | Java**, or configure the Adapter for Eclipse Code
Formatter plugin to use the file and select the `conquery` profile. In either case, Maven/Spotless defines the expected
output.

### Testing

#### Integration Tests
Expand Down
23 changes: 11 additions & 12 deletions autodoc/src/main/java/com/bakdata/conquery/AutoDoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,24 @@ private static void configureJavaParser() {
private final ScanResult scan;

public AutoDoc() {
scan = new ClassGraph()
.enableAllInfo()
//reject some packages that contain large libraries
.rejectPackages(
"groovy",
"org.codehaus.groovy",
"org.apache",
"org.eclipse",
"com.google"
)
.scan();
scan = new ClassGraph().enableAllInfo()
//reject some packages that contain large libraries
.rejectPackages(
"groovy",
"org.codehaus.groovy",
"org.apache",
"org.eclipse",
"com.google"
)
.scan();
}

public void start(File docs) throws IOException {
docs.mkdirs();
for (Group group : GROUPS) {
File target = new File(docs, group.getName().replace(' ', '-') + ".md");
try (var out = new SimpleWriter(
new OutputStreamWriter(new FileOutputStream(target), StandardCharsets.UTF_8)
new OutputStreamWriter(new FileOutputStream(target), StandardCharsets.UTF_8)
)) {
new GroupHandler(scan, group, out, docs.getCanonicalFile().getParentFile()).handle();
}
Expand Down
Loading
Loading