1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-05-09 18:34:06 +02:00

Fix some qodana inspections

This commit is contained in:
Alex Plate 2022-11-10 13:38:18 +02:00
parent 2a3e96b891
commit 785f29abf8
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F
5 changed files with 7 additions and 13 deletions
.idea/inspectionProfiles
qodana.yaml
src
main
java/com/maddyhome/idea/vim
resources/messages
test/java/org/jetbrains/plugins/ideavim

View File

@ -37,6 +37,7 @@
<inspection_tool class="MissortedModifiers" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_requireAnnotationsFirst" value="true" />
</inspection_tool>
<inspection_tool class="SameParameterValue" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SameReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />

View File

@ -19,4 +19,5 @@ exclude:
- src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/JavaText.kt
- src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/LoremText.kt
- src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/SimpleText.kt
- src/main/java/com/maddyhome/idea/vim/vimscript/parser/generated
- src/main/java/com/maddyhome/idea/vim/vimscript/parser/generated
- src/main/java/com/maddyhome/idea/vim/package-info.java

View File

@ -1,7 +0,0 @@
/*
* Copyright 2003-2022 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
* https://opensource.org/licenses/MIT.
*/

View File

@ -102,7 +102,6 @@ unable.to.find.0=Unable to find {0}
more.ret.line.space.page.d.half.page.q.quit=-- MORE -- (RET: line, SPACE: page, d: half page, q: quit)
hit.enter.or.type.command.to.continue=Hit ENTER or type command to continue
ex.output.panel.more=-- MORE --
command.name.vim.macro.playback=Vim Macro Playback
action.no.changes.text=No Changes
action.reload.text=Reload
replace.with.0=Replace with {0} (y/n/a/q/l)?

View File

@ -173,7 +173,7 @@ abstract class VimTestCase : UsefulTestCase() {
protected fun configureByText(content: String) = configureByText(PlainTextFileType.INSTANCE, content)
protected fun configureByJavaText(content: String) = configureByText(JavaFileType.INSTANCE, content)
protected fun configureByXmlText(content: String) = configureByText(XmlFileType.INSTANCE, content)
protected fun configureByJsonText(content: String) = configureByText(JsonFileType.INSTANCE, content)
protected fun configureByJsonText(@Suppress("SameParameterValue") content: String) = configureByText(JsonFileType.INSTANCE, content)
protected fun configureAndGuard(content: String) {
val ranges = extractBrackets(content)
@ -182,7 +182,7 @@ abstract class VimTestCase : UsefulTestCase() {
}
}
protected fun configureAndFold(content: String, placeholder: String) {
protected fun configureAndFold(content: String, @Suppress("SameParameterValue") placeholder: String) {
val ranges = extractBrackets(content)
myFixture.editor.foldingModel.runBatchFoldingOperation {
for ((start, end) in ranges) {
@ -557,7 +557,7 @@ abstract class VimTestCase : UsefulTestCase() {
// Specify width in columns, not pixels, just like we do for visible screen size. The default text char width differs
// per platform (e.g. Windows is 7, Mac is 8) so we can't guarantee correct positioning for tests if we use hard coded
// pixel widths
protected fun addInlay(offset: Int, relatesToPrecedingText: Boolean, widthInColumns: Int): Inlay<*> {
protected fun addInlay(offset: Int, relatesToPrecedingText: Boolean, @Suppress("SameParameterValue") widthInColumns: Int): Inlay<*> {
val widthInPixels = (EditorHelper.getPlainSpaceWidthFloat(myFixture.editor) * widthInColumns).roundToInt()
return EditorTestUtil.addInlay(myFixture.editor, offset, relatesToPrecedingText, widthInPixels)
}
@ -566,7 +566,7 @@ abstract class VimTestCase : UsefulTestCase() {
// height on all platforms, so can't guarantee correct positioning for tests if we use pixels. This currently limits
// us to integer multiples of line heights. I don't think this will cause any issues, but we can change this to a
// float if necessary. We'd still be working scaled to the line height, so fractional values should still work.
protected fun addBlockInlay(offset: Int, showAbove: Boolean, heightInRows: Int): Inlay<*> {
protected fun addBlockInlay(offset: Int, @Suppress("SameParameterValue") showAbove: Boolean, heightInRows: Int): Inlay<*> {
val widthInColumns = 10 // Arbitrary width. We don't care.
val widthInPixels = (EditorHelper.getPlainSpaceWidthFloat(myFixture.editor) * widthInColumns).roundToInt()
val heightInPixels = myFixture.editor.lineHeight * heightInRows