Skip to content

Commit

Permalink
Merge branch 'main' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
FWDekker committed Nov 17, 2023
2 parents b19e568 + 96a0856 commit e4c4382
Show file tree
Hide file tree
Showing 318 changed files with 17,648 additions and 16,609 deletions.
128 changes: 72 additions & 56 deletions .config/detekt/.detekt.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,81 @@
comments:
# License in each file is unnecessary.
AbsentOrWrongFileLicense:
active: false
# Nothing wrong with documenting private methods.
CommentOverPrivateFunction:
active: false
# Nothing wrong with documenting private properties.
CommentOverPrivateProperty:
active: false
# Bugged, see https://github.com/detekt/detekt/issues/4727, fixed in Detekt 1.21.0
OutdatedDocumentation:
active: false
# [Disagree] License in each file is unnecessary.
AbsentOrWrongFileLicense:
active: false
# [Disagree] Simple private functions should be documented too.
CommentOverPrivateFunction:
active: false
# [Disagree] Simple private properties should be documented too.
CommentOverPrivateProperty:
active: false

complexity:
# Static analysis is not good at estimating this.
TooManyFunctions:
thresholdInClasses: 20
# Acceptable if used sparingly.
LabeledExpression:
active: false
# [Disagree] Acceptable if used sparingly.
LabeledExpression:
active: false
# [False Positive] Solved using resource bundles. All remaining duplicates are resource identifiers.
StringLiteralDuplication:
active: false
# [Exception] Acceptable for helper files.
TooManyFunctions:
excludes: '**/*Helpers.kt'

formatting:
# Experimental. Too many false positives.
ArgumentListWrapping:
active: false
# That's part of my code style.
NoConsecutiveBlankLines:
active: false
# Acceptable because of auto-formatting.
MultiLineIfElse:
active: false

naming:
# Static analysis is not good at estimating this.
FunctionMaxLength:
active: false
# Cannot be suppressed in case of false positives.
MatchingDeclarationName:
active: false
# [Disagree] Acceptable for many short arguments.
ArgumentListWrapping:
active: false
# [Bug] Incorrectly detects violation if semicolon is followed by more than one newline.
EnumWrapping:
active: false
# [Disagree] Multi-line expressions are easier to understand if they start on the next line.
FunctionSignature:
active: false
# [Disagree] Short one-liners are easier to understand.
IfElseWrapping:
active: false
# [Bug] Causes ugly indentation when using named multiline arguments to a function.
MultilineExpressionWrapping:
active: false
# [Disagree] Braces use unnecessary extra space.
MultiLineIfElse:
active: false
# [Disagree] Consecutive blank lines are used consistently to group blocks of code.
NoConsecutiveBlankLines:
active: false
# [Disagree] Required for lists and varargs, but ugly when it is unlikely that the function signature will change.
TrailingCommaOnCallSite:
active: false

potential-bugs:
# The alternative is to safe cast and throw an exception, which is equally bad.
UnsafeCast:
active: false
# [Exception] Initialised by scene builder.
LateinitUsage:
ignoreOnClassesPattern: ".*Editor"

style:
# Those functions are added as conscious design decisions.
DataClassContainsFunctions:
active: false
# Not if they're settings objects.
DataClassShouldBeImmutable:
active: false
# Not an issue if names are self-explanatory.
DestructuringDeclarationWithTooManyEntries:
active: false
# Such comments are OK.
ForbiddenComment:
active: false
# No braces are easier to read.
MandatoryBracesIfStatements:
active: false
# False positives when there are two newlines after the imports.
SpacingBetweenPackageAndImports:
active: false
# [Disagree] `apply` is confusing to use because of namespace conflicts.
AlsoCouldBeApply:
active: false
# [Disagree] Braces use unnecessary extra space, but consistency helps in legibility.
BracesOnIfStatements:
multiLine: consistent
# [Disagree] Legibility is possible despite consistency because it is wrapped in a multi-line `when` block.
BracesOnWhenStatements:
multiLine: necessary
# [Disagree] Functions on data classes are useful.
DataClassContainsFunctions:
active: false
# [Disagree] Mutable data classes are useful.
DataClassShouldBeImmutable:
active: false
# [Exception] Acceptable in (parameterized) tests.
DestructuringDeclarationWithTooManyEntries:
excludes: '**/test/**'
# [Bug] Fails when used as function expression body.
MultilineRawStringIndentation:
active: false
# [Bug] False positives when there are two newlines after the imports.
SpacingBetweenPackageAndImports:
active: false
# [Bug] Suggests using raw string in constant, but then `trimIndent` is not possible, resulting in weird indenting.
StringShouldBeRawString:
active: false
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ insert_final_newline = true

indent_style = space
indent_size = 4

[*.yml]
indent_size = 2
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*.dic binary
*.sketch binary
*.svg binary
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Pull requests that do not meet the following guidelines are **fine**; these are

### 📚 Documentation
Always update related documentation, both code documentation and user instructions such as the [README](../README.md).
Additionally, make sure you update the [change notes](../src/main/resources/META-INF/change-notes.html) if necessary.
Additionally, make sure you update the [change notes](../CHANGELOG.md) if necessary.

### 🧪 Tests
If you fixed a bug or added a new feature, make sure you add tests that cover this.
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ assignees: FWDekker
<!-- If applicable, add screenshots to help explain your problem. -->

**Version information**
- Randomness version [e.g. 2.7.6]: <!-- Check `Settings -> Plugins` in your IDE and search for `Randomness` -->
- IDE version [e.g. IntelliJ Community 2022.3]: <!-- Check `Help -> About` in your IDE -->
- Operating system [e.g. Windows 11, Ubuntu 22.10, macOS 13.1]: <!-- Use a search engine for help if you don't know -->
- Java version [e.g. 11.0.17, 17.0.5]: <!-- Run `java --version` in a terminal or check https://www.java.com/en/download/help/version_manual.xml -->
- Randomness version [e.g. 2.7.7]: <!-- Check `Settings -> Plugins` in your IDE and search for `Randomness` -->
- IDE version [e.g. IntelliJ Community 2023.1.3]: <!-- Check `Help -> About` in your IDE -->
- Operating system [e.g. Windows 11, Ubuntu 22.04.2, macOS 13.4.1]: <!-- Use a search engine for help if you don't know -->
- Java version [e.g. 17.0.5, 19.0.2]: <!-- Run `java -version` in a terminal or check https://www.java.com/en/download/help/version_manual.xml -->

**Additional context**
<!-- Add any other context about the problem here. -->
30 changes: 23 additions & 7 deletions .github/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
# Release checklist
## Documentation
* Bump the version number according to [Semantic Versioning](https://semver.org/).
* Update `README.md`, `change-notes.html`, and `description.html` if necessary.
* Make sure to preview the change notes in the IDE by loading the plugin.
* Update screenshots in `.github/img/` and on the plugin repository if necessary.
* Distance between bottom of "Refresh" button and top of button bar at bottom is 50 pixels, or the original distance,
whichever is smaller.
* Ensure documentation generates without errors and push documentation to `gh-pages` branch.
* Update [`README.md`](../README.md), [`CHANGELOG.md`](../CHANGELOG.md), and
[`description.html`](../src/main/resources/META-INF/description.html) if necessary.
* Make sure to preview the change notes in the IDE by loading the plugin.
* Make sure the list of acknowledgements is up-to-date.
* Update screenshots and GIFs in `.github/img/` and on the plugin repository if necessary.
* Set the global UI scale to 200% before recording/screenshotting to ensure high-resolution images.
* Use the project in `src/test/resources/screenshots/` to store code snippets in.
Do not store `.idea/`, `.gradle`, and similar build files in this project.
* Hide (inlay) hints and set font size to 20.
* Distance between bottom of "Refresh" button and top of button bar at bottom is 50 pixels, or the original
distance, whichever is smaller.
* On Linux, the screen can be recorded using [peek](https://github.com/phw/peek) or
[SimpleScreenRecorder](https://www.maartenbaert.be/simplescreenrecorder/).
* Reducing GIF size is a difficult process.
The following seems to work fine:
1. `for f in ./*.webm; do ffmpeg -y -i "$f" -vf "fps=10,scale=768:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "${f%.*}.gif"; done`
2. Go to [ezgif](https://ezgif.com/optimize) and upload the GIF to reduce in size.
3. Apply the following optimisations in question; after each result, you can click "Optimize" to apply another filter:
1. "Color Reduction" to 64 colours
2. "Optimize Transparency" with 2% fuzz
3. "Lossy GIF" with compression level 30
* Ensure documentation generates without errors, and push the documentation to the `gh-pages` branch.

## Verification
* Run tests and static analysis one more time.
* Try out the plugin yourself and check that old and new features work properly.
* Run the plugin verifier.
* Make sure the latest IDE version is in the plugin verifier's configuration.
* Make sure the latest IDE version is in the plugin verifier's configuration.
* Ensure settings from the previous version correctly load into the new version.
5 changes: 3 additions & 2 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Security policy
## Supported versions
Only the [latest version](https://github.com/FWDekker/intellij-randomness/releases/latest) is ever supported and supplied with security patches.
Only the [latest version](https://github.com/FWDekker/intellij-randomness/releases/latest) is ever supported and
supplied with security patches.

## Reporting a vulnerability
To report a security vulnerability, send an email to [email protected] instead of using the issue tracker.
To report a security vulnerability, email `[email protected]` instead of using the issue tracker.
You will be contacted as soon as possible.
Binary file added .github/img/array-insertion-sample.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/configuration-sample.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/fast-insertion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/img/icons.sketch
Binary file not shown.
Binary file added .github/img/insertion-sample.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .github/img/live-sample.gif
Binary file not shown.
Binary file added .github/img/previews.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/shortcuts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .github/img/word-settings.png
Binary file not shown.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
push:
paths-ignore:
- 'README.md'
- '.github/**.md'
- '.github/img/**'
pull_request:
paths-ignore:
- 'README.md'
- '.github/**.md'
- '.github/img/**'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Run checks (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
chmod +x ./gradlew
sudo apt install -y xvfb
xvfb-run --auto-servernum ./gradlew --no-daemon check
./gradlew --stop
- name: Run checks (Windows)
if: matrix.os == 'windows-latest'
run: |
./gradlew --no-daemon check
./gradlew --stop
- uses: codecov/codecov-action@v3
if: success() && matrix.os == 'ubuntu-latest'
with:
fail_ci_if_error: true
files: build/reports/kover/report.xml
16 changes: 12 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,37 @@
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*



## Gradle
.gradle
/build/
/out/
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Work around https://youtrack.jetbrains.com/issue/IDEA-116898
gradle/wrapper/gradle-wrapper.properties
# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit e4c4382

Please sign in to comment.