Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .editorconfig and lint github workflow #50

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[*.java]
indent_style = tab
tab_width = 4
end_of_line = crlf
charset = utf-8
insert_final_newline = true

ij_java_imports_layout = *,|,javax.**,java.**,|,$*
ij_java_class_count_to_use_import_on_demand = 9999
ij_java_names_count_to_use_import_on_demand = 9999

# 'catch (' instead of 'catch(' and so on...
ij_java_space_before_catch_parentheses = true
ij_java_space_before_for_parentheses = true
ij_java_space_before_if_parentheses = true
ij_java_space_before_switch_parentheses = true
ij_java_space_before_try_parentheses = true
ij_java_space_before_while_parentheses = true

ij_java_blank_lines_after_imports = 1 # blank line between last import and class definition
ij_java_blank_lines_after_class_header = 1
ij_java_blank_lines_before_class_end = 1 # blank line before closing } of class
ij_java_blank_lines_around_method = 1

ij_java_doc_enable_formatting = true
ij_java_doc_align_param_comments = true
ij_java_doc_align_exception_comments = true
ij_java_doc_keep_empty_lines = true
ij_java_doc_add_p_tag_on_empty_lines = true

[*.yml]
indent_style = space
indent_size = 2
charset = utf-8
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Lint

on:
push: null
pull_request: null

jobs:
build:
name: Lint
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0

- name: Super-linter
uses: super-linter/[email protected] # x-release-please-version
env:
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Will parse the entire repository and find all files to validate across all types.
# NOTE: When set to false, only new or edited files will be parsed for validation.
VALIDATE_ALL_CODEBASE: true
# Default repository branch when running on GitHub Actions
DEFAULT_BRANCH: main
VALIDATE_JAVA: true