Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4e6f0a8
Add megalinter config
ljacqu Aug 30, 2025
8625077
Update MegaLinter config
ljacqu Aug 30, 2025
4692185
Checkstyle
ljacqu Aug 30, 2025
e1e96dc
Merge remote-tracking branch 'origin/master' into megalinter
ljacqu Aug 30, 2025
18df59e
try to get Checkstyle to run
ljacqu Aug 30, 2025
eb6db41
try to get Checkstyle to run
ljacqu Aug 30, 2025
83f57be
Ignore java tests in copy&paste detection
ljacqu Aug 30, 2025
30c3545
Ignore java tests in copy&paste detection
ljacqu Aug 31, 2025
38d0b02
Merge remote-tracking branch 'origin/master' into megalinter
ljacqu Aug 31, 2025
dcafa69
Test Checkstyle errors, fix some md stuff, remove jscpd, temp test fo…
ljacqu Aug 31, 2025
6f615fb
fix perms
ljacqu Aug 31, 2025
1edc9e1
Try to include only .github/ files for yaml
ljacqu Aug 31, 2025
f4f5aed
try spell check, attempt to see Checkstyle errors
ljacqu Aug 31, 2025
3fc9dfe
update
ljacqu Aug 31, 2025
ebc2bc9
format yaml, disable sarif to see if checkstyle errors remain
ljacqu Aug 31, 2025
e284162
yaml fun, re-add sarif
ljacqu Aug 31, 2025
7e8e321
yaml, disable sarif, checkstyle severity error
ljacqu Aug 31, 2025
bdd8578
yaml-lint / disable linters instead?
ljacqu Aug 31, 2025
410a5ee
YAML tweaks / test with actual CI error / disable spellchecks
ljacqu Aug 31, 2025
d6c0959
quick yaml test / clean up config / ...
ljacqu Aug 31, 2025
18755bb
Revert test changes
ljacqu Aug 31, 2025
8ea44a6
Merge remote-tracking branch 'origin/master' into megalinter
ljacqu Aug 31, 2025
ecc45a5
update
ljacqu Aug 31, 2025
d5ae0fe
Merge remote-tracking branch 'origin/master' into megalinter
ljacqu Aug 31, 2025
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
19 changes: 9 additions & 10 deletions .checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
In order to be compatible with CodeClimate, we have to stay in sync with the version of Checkstyle that they are using.
It doesn't seem to be updated much by default, but we can specify a channel, which is currently using 10.7.0.
Check the links below to get up-to-date version information.
https://github.com/codeclimate/codeclimate-checkstyle/branches/all (channel/ branches)
https://docs.codeclimate.com/docs/checkstyle
https://github.com/codeclimate/codeclimate-checkstyle/blob/master/bin/install-checkstyle.sh
In order to be compatible with Megalint, we have to stay in sync with the version of Checkstyle that they are using.
This is, at the time of writing, 10.25.0. Check the documentation to get up-to-date version information:
https://megalinter.io/8.8.0/descriptors/java_checkstyle/
The output of the GitHub Action also reports the Checkstyle version:
https://github.com/AuthMe/ConfigMe/actions/workflows/mega-linter.yml?query=branch%3Amaster
-->

<module name="Checker">
<property name="charset" value="UTF-8" />
<property name="severity" value="warning" />
<property name="severity" value="error" />
<property name="fileExtensions" value="java" />

<module name="SuppressWarningsFilter" />
Expand Down Expand Up @@ -147,7 +146,7 @@
<module name="JavadocTagContinuationIndentation" />
<module name="JavadocType" />
<module name="JavadocVariable">
<property name="scope" value="package" />
<property name="accessModifiers" value="package" />
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="package" />
Expand Down
39 changes: 0 additions & 39 deletions .codeclimate.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .config/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rules:
line-length:
max: 120

# GitHub Actions use 'on' as key in their config, which hits the "truthy" check. Disable it.
# https://github.com/adrienverge/yamllint/issues/430
truthy:
check-keys: false
192 changes: 192 additions & 0 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
---
name: MegaLinter

# Trigger mega-linter at every push. Action will also be visible from
# Pull Requests to master
on:
# Comment this line to trigger action only on pull-requests
# (not recommended if you don't pay for GH Actions)
push:

pull_request:
branches:
- master

# Permissions. Depending on config, contents: write, issues: write and pull-requests: write should be added
permissions:
contents: read
pull-requests: write

# Comment env block if you do not want to apply fixes
env:
# Apply linter fixes configuration
#
# When active, APPLY_FIXES must also be defined as environment variable
# (in github/workflows/mega-linter.yml or other CI tool)
APPLY_FIXES: none

# Decide which event triggers application of fixes in a commit or a PR
# (pull_request, push, all)
APPLY_FIXES_EVENT: pull_request

# If APPLY_FIXES is used, defines if the fixes are directly committed (commit)
# or posted in a PR (pull_request)
APPLY_FIXES_MODE: commit

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest

steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}

# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
# improve performance
fetch-depth: 0

# MegaLinter
- name: MegaLinter

# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.io/latest/flavors/
uses: oxsecurity/megalinter/flavors/java@v8

id: ml

# All available variables are described in documentation
# https://megalinter.io/latest/config-file/
env:
# Validates all source when push on master, else just the git diff with
# master. Override with true if you always want to lint all sources
#
# To validate the entire codebase, set to:
# VALIDATE_ALL_CODEBASE: true
#
# To validate only diff with master, set to:
# VALIDATE_ALL_CODEBASE: >-
# ${{
# github.event_name == 'push' &&
# github.ref == 'refs/heads/master'
# }}
VALIDATE_ALL_CODEBASE: true

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Uncomment to use ApiReporter (Grafana)
# API_REPORTER: true
# API_REPORTER_URL: ${{ secrets.API_REPORTER_URL }}
# API_REPORTER_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }}
# API_REPORTER_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }}
# API_REPORTER_METRICS_URL: ${{ secrets.API_REPORTER_METRICS_URL }}
# API_REPORTER_METRICS_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }}
# API_REPORTER_METRICS_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }}
# API_REPORTER_DEBUG: false

# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF
# .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY

# Upload MegaLinter artifacts
- name: Archive production artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: MegaLinter reports
include-hidden-files: "true"
path: |
megalinter-reports
mega-linter.log

# Create pull request if applicable
# (for now works only on PR from same repository, not from forks)
- name: Create Pull Request with applied fixes
uses: peter-evans/create-pull-request@v6
id: cpr
if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'pull_request' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
commit-message: "[MegaLinter] Apply linters automatic fixes"
title: "[MegaLinter] Apply linters automatic fixes"
labels: bot

- name: Create PR output
if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'pull_request' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
run: |
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"

# Push new commit if applicable
# (for now works only on PR from same repository, not from forks)
- name: Prepare commit
if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'commit' &&
github.ref != 'refs/heads/master' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
run: sudo chown -Rc $UID .git/

- name: Commit and push applied linter fixes
uses: stefanzweifel/git-auto-commit-action@v5
if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'commit' &&
github.ref != 'refs/heads/master' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
with:
branch: >-
${{
github.event.pull_request.head.ref ||
github.head_ref ||
github.ref
}}
commit_message: "[MegaLinter] Apply linters fixes"
commit_user_name: megalinter-bot
commit_user_email: 129584137+megalinter-bot@users.noreply.github.com
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ nb-configuration.xml
### Git ###
# Don't exclude the .gitignore itself
!.gitignore

megalinter-reports/
2 changes: 1 addition & 1 deletion .idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Configuration file for MegaLinter
#
# See all available variables at https://megalinter.io/latest/config-file/ and in
# linters documentation

# all, none, or list of linter keys
APPLY_FIXES: none
PRINT_ALPACA: false

# See https://megalinter.io/8.8.0/flavors/java/ for a list of linters
DISABLE_LINTERS:
- COPYPASTE_JSCPD
- EDITORCONFIG_EDITORCONFIG_CHECKER
- JAVA_PMD
- JSON_V8R
- JSON_JSONLINT
- JSON_PRETTIER
- SPELL_CSPELL
- SPELL_LYCHEE
- XML_XMLLINT
- YAML_PRETTIER

# Exclude test files - some are intentionally badly formatted, some produce encoding issues, etc.
YAML_FILTER_REGEX_EXCLUDE: 'src/test/.*'
YAML_YAMLLINT_CONFIG_FILE: '.config/yamllint.yml'
# YAML lint errors shouldn't mark the MegaLinter action as failed
YAML_YAMLLINT_DISABLE_ERRORS: true

# Markdown lint errors shouldn't mark the MegaLinter action as failed
MARKDOWN_MARKDOWNLINT_DISABLE_ERRORS: true

# https://megalinter.io/8.8.0/descriptors/java_checkstyle/
JAVA_CHECKSTYLE_CONFIG_FILE: '.checkstyle.xml'
JAVA_CHECKSTYLE_FILTER_REGEX_INCLUDE: 'src/main'

# Uncomment if you want MegaLinter to detect errors but not block CI to pass
# DISABLE_ERRORS: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Build Status](https://github.com/AuthMe/ConfigMe/actions/workflows/maven_jdk8.yml/badge.svg)](https://github.com/AuthMe/ConfigMe/actions?query=branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/github/AuthMe/ConfigMe/badge.svg?branch=master)](https://coveralls.io/github/AuthMe/ConfigMe?branch=master)
[![Javadocs](https://www.javadoc.io/badge/ch.jalu/configme.svg)](https://www.javadoc.io/doc/ch.jalu/configme)
[![Code Climate](https://codeclimate.com/github/AuthMe/ConfigMe/badges/gpa.svg)](https://codeclimate.com/github/AuthMe/ConfigMe)
[![MegaLinter](https://github.com/AuthMe/ConfigMe/workflows/MegaLinter/badge.svg?branch=master)](https://github.com/AuthMe/ConfigMe/actions?query=workflow%3AMegaLinter+branch%3Amaster)

A simple configuration management library with YAML support out of the box.

Expand Down