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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

# Java files
[*.java]
indent_style = space
indent_size = 4
max_line_length = 120

# XML files (pom.xml, etc.)
[*.xml]
indent_style = space
indent_size = 4

# YAML files
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# Markdown files
[*.md]
trim_trailing_whitespace = false
max_line_length = off

# Properties files
[*.properties]
indent_style = space
indent_size = 4
29 changes: 27 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
* text=auto

# Source files
*.java text diff=java
*.xml text
*.properties text

# Web files
*.html text diff=html
*.css text
*.js text
*.xml text
.travis.yml text

# Documentation
*.md text diff=markdown
*.txt text

# Configuration files
*.yml text
*.yaml text
.editorconfig text
.gitignore text
.gitattributes text

# Scripts
*.sh text eol=lf
*.bat text eol=crlf

# Archives
*.jar binary
*.zip binary
*.tar binary
*.gz binary

# Test files - specific binary files
src/test/resources/org/htmlunit/cyberneko/testfiles/test010.html binary
src/test/resources/org/htmlunit/cyberneko/testfiles/test011.html binary

Expand Down
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Parse HTML with '...'
2. Use parser configuration '....'
3. Call method '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Code Example**
```java
// Minimal code example to reproduce the issue
DOMParser parser = new DOMParser();
// ...
```

**HTML Sample**
```html
<!-- The HTML that causes the issue -->
<!DOCTYPE html>
<html>
...
</html>
```

**Environment (please complete the following information):**
- OS: [e.g. Windows 10, Ubuntu 20.04]
- Java Version: [e.g. 8, 11, 17]
- HtmlUnit NekoHTML Version: [e.g. 4.18.0]

**Stack Trace**
If applicable, add the full stack trace:
```
Exception in thread "main" ...
```

**Additional context**
Add any other context about the problem here.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Use Case**
Describe how this feature would be used in practice:
```java
// Example code showing how the feature would be used
parser.setFeature(NEW_FEATURE, true);
// ...
```

**Additional context**
Add any other context, screenshots, or examples about the feature request here.

**Would you be willing to implement this feature?**
- [ ] Yes, I can submit a pull request
- [ ] No, but I can help with testing
- [ ] No, just suggesting the idea
57 changes: 57 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## Description
<!-- Provide a brief description of the changes in this PR -->

## Type of Change
<!-- Mark the relevant option with an "x" -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code quality improvement
- [ ] Performance improvement

## Related Issue
<!-- Link to the issue this PR addresses -->
Fixes #(issue number)

## Changes Made
<!-- Describe the changes made in this PR -->
-
-
-

## Testing
<!-- Describe the tests you ran to verify your changes -->
- [ ] All existing tests pass (`mvn test`)
- [ ] Added new tests for the changes
- [ ] Tested with various Java versions (8, 11, 17, 21)
- [ ] Manual testing performed

### Test Cases Added
<!-- List any new test cases -->
-
-

## Quality Checks
<!-- Mark completed checks with an "x" -->
- [ ] Code follows the project's code style (`mvn checkstyle:check`)
- [ ] No new SpotBugs warnings (`mvn spotbugs:check`)
- [ ] No new PMD violations (`mvn pmd:check`)
- [ ] JavaDoc added/updated for public APIs
- [ ] README.md updated (if applicable)

## Screenshots (if applicable)
<!-- Add screenshots to help explain your changes -->

## Additional Notes
<!-- Add any additional notes for reviewers -->

## Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
matrix:
java: ['8', '11', '17', '21']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'

- name: Build with Maven
run: mvn -B clean compile --file pom.xml

- name: Run tests
run: mvn -B test --file pom.xml

- name: Generate test report
if: always()
run: mvn surefire-report:report-only

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-java-${{ matrix.java }}
path: target/surefire-reports/
retention-days: 7

- name: Upload coverage report
if: matrix.java == '8'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: target/site/jacoco/
retention-days: 30

quality:
name: Code Quality Checks
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'

- name: Compile code
run: mvn -B clean compile --file pom.xml

- name: Run Checkstyle
run: mvn checkstyle:checkstyle --file pom.xml
continue-on-error: true

- name: Upload Checkstyle report
uses: actions/upload-artifact@v4
with:
name: checkstyle-report
path: target/checkstyle-result.xml
retention-days: 7

- name: Run SpotBugs
run: mvn spotbugs:spotbugs --file pom.xml
continue-on-error: true

- name: Upload SpotBugs report
uses: actions/upload-artifact@v4
with:
name: spotbugs-report
path: target/spotbugsXml.xml
retention-days: 7

- name: Run PMD
run: mvn pmd:pmd --file pom.xml
continue-on-error: true

- name: Upload PMD report
uses: actions/upload-artifact@v4
with:
name: pmd-report
path: target/pmd.xml
retention-days: 7
22 changes: 10 additions & 12 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
uses: actions/checkout@v4

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +52,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +66,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
Loading