Skip to content

Commit

Permalink
chore: run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Jun 16, 2024
1 parent c75aad4 commit c51cd8d
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 131 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/pre-commit-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Pre-commit consistency check"
name: Pre-commit consistency check

on:
workflow_dispatch:
Expand All @@ -13,29 +13,29 @@ jobs:
name: Run pre-commit checks
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: dorny/paths-filter@v2
id: filter
with:
list-files: shell
filters: |
addedOrModified:
- added|modified: '**'
- uses: dorny/paths-filter@v2
id: filter
with:
list-files: shell
filters: |
addedOrModified:
- added|modified: '**'
# run only if changed files were detected
- name: Run against changes
uses: pre-commit/[email protected]
if: steps.filter.outputs.addedOrModified == 'true'
with:
extra_args: --files ${{ steps.filter.outputs.addedOrModified_files }}
- name: Run against changes
uses: pre-commit/[email protected]
if: steps.filter.outputs.addedOrModified == 'true'
with:
extra_args: --files ${{ steps.filter.outputs.addedOrModified_files }}

# run if no changed files were detected (e.g. workflow_dispatch on master branch)
- name: Run against all files
uses: pre-commit/[email protected]
if: steps.filter.outputs.addedOrModified != 'true'
with:
extra_args: --all-files
- name: Run against all files
uses: pre-commit/[email protected]
if: steps.filter.outputs.addedOrModified != 'true'
with:
extra_args: --all-files
62 changes: 31 additions & 31 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
workflow_dispatch:
push:
branches:
- master
- master
name: release-please
jobs:
release-please:
Expand All @@ -12,11 +12,11 @@ jobs:
upload_url: ${{ steps.release.outputs.upload_url }}
# https://github.com/google-github-actions/release-please-action in case more config is needed
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{ secrets.PAT }}
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{ secrets.PAT }}
# See how to configure file https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md
# See output info at https://github.com/google-github-actions/release-please-action#configuration for variables

Expand All @@ -30,28 +30,28 @@ jobs:
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v3
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Download MC assets
run: ./gradlew downloadAssets || ./gradlew downloadAssets || (sleep 30s && ./gradlew downloadAssets)
- name: Run DataGen
run: ./gradlew runData
- name: Build and publish (release)
env:
CURSE_API: ${{ secrets.CURSE_API }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
IS_RELEASE: true
run: |
# Build
./gradlew build ${{ matrix.release-task }}
- uses: actions/checkout@v3
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- name: Download MC assets
run: ./gradlew downloadAssets || ./gradlew downloadAssets || (sleep 30s && ./gradlew downloadAssets)
- name: Run DataGen
run: ./gradlew runData
- name: Build and publish (release)
env:
CURSE_API: ${{ secrets.CURSE_API }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
IS_RELEASE: true
run: |
# Build
./gradlew build ${{ matrix.release-task }}
40 changes: 20 additions & 20 deletions .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches-ignore:
- master
- master
workflow_dispatch:
name: Build
jobs:
Expand All @@ -10,28 +10,28 @@ jobs:
runs-on: ubuntu-latest
# https://github.com/google-github-actions/release-please-action in case more config is needed
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
# these if statements ensure that a publication only occurs when
# a new release is created:
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
# - name: Download MC assets
# run: ./gradlew downloadAssets --info --debug || ./gradlew downloadAssets --info --debug || (sleep 30s && ./gradlew downloadAssets --info --debug)
# - name: Run DataGen
# run: ./gradlew runData
- name: Build and upload preview (run for non-release builds)
if: ${{ github.ref && !contains( github.ref, 'renovate/deps') }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
# Build
./gradlew build
- name: Build and upload preview (run for non-release builds)
if: ${{ github.ref && !contains( github.ref, 'renovate/deps') }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
# Build
./gradlew build
38 changes: 24 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# See https://pre-commit.com for more information
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: check-merge-conflict
- id: check-case-conflict
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: check-merge-conflict
- id: check-case-conflict

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: remove-crlf
- id: remove-tabs
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: remove-crlf
- id: remove-tabs

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.13.0
hooks:
- id: pretty-format-java
args: [--autofix]
- id: pretty-format-yaml
args: [--autofix]
- id: pretty-format-toml
args: [--autofix]
88 changes: 44 additions & 44 deletions spigot/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,48 @@ author: sekwah41
description: An advanced portals plugin for bukkit.
api-version: 1.13
commands:
portal:
description: The main command for the advanced portals
aliases: [portals, aportals, advancedportals]
usage: /<command>
destination:
description: Can be used to access portal destinations.
aliases: [desti]
usage: /<command>
portal:
description: The main command for the advanced portals
aliases: [portals, aportals, advancedportals]
usage: /<command>
destination:
description: Can be used to access portal destinations.
aliases: [desti]
usage: /<command>
permissions:
advancedportals.*:
description: Gives access to all commands
default: op
children:
advancedportals.createportal: true
advancedportals.portal: true
advancedportals.build: true
advancedportals.desti: true
advancedportals.createportal:
description: Allows you to create portals
default: op
advancedportals.createportal.commandlevel.*:
description: Gives access to all level raisers
default: false
children:
advancedportals.createportal.commandlevel.op: true
advancedportals.createportal.commandlevel.perms: true
advancedportals.createportal.commandlevel.console: true
advancedportals.createportal.commandlevel.op:
description: Allows you to increase the users level temporaily to op
default: false
advancedportals.createportal.commandlevel.perms:
description: Allows you to increase the users level temporaily to have all perms
default: false
advancedportals.createportal.commandlevel.console:
description: Executes command in the console
default: false
advancedportals.portal:
description: Allows use of portal commands
default: op
advancedportals.build:
description: Allows you to build in the portal regions
default: op
advancedportals.desti:
description: Gives access to all desti commands
default: op
advancedportals.*:
description: Gives access to all commands
default: op
children:
advancedportals.createportal: true
advancedportals.portal: true
advancedportals.build: true
advancedportals.desti: true
advancedportals.createportal:
description: Allows you to create portals
default: op
advancedportals.createportal.commandlevel.*:
description: Gives access to all level raisers
default: false
children:
advancedportals.createportal.commandlevel.op: true
advancedportals.createportal.commandlevel.perms: true
advancedportals.createportal.commandlevel.console: true
advancedportals.createportal.commandlevel.op:
description: Allows you to increase the users level temporaily to op
default: false
advancedportals.createportal.commandlevel.perms:
description: Allows you to increase the users level temporaily to have all perms
default: false
advancedportals.createportal.commandlevel.console:
description: Executes command in the console
default: false
advancedportals.portal:
description: Allows use of portal commands
default: op
advancedportals.build:
description: Allows you to build in the portal regions
default: op
advancedportals.desti:
description: Gives access to all desti commands
default: op

0 comments on commit c51cd8d

Please sign in to comment.