How to disable code inspection errors in README.md file in Android Studio

Viewed 2394

In my GitHub README.md file, which is in the root of my Android project, I have code snippets like the following ones:

```xml
android:windowSoftInputMode="stateHidden"
```

```java
MongolToast.makeText(getApplicationContext(), "ᠰᠠᠢᠨ ᠪᠠᠢᠨ᠎ᠠ ᠤᠤ︖", MongolToast.LENGTH_LONG).show();
```

However, in Android Studio these code snippets give errors

enter image description here

I don't want to be warned of supposed code errors in the README file. How do I disable all errors here?

Notes:

  • I know how to suppress inspections normally in code with @SuppressLint or going into settings and unchecking the lint inspection. I don't want these errors to be suppressed in other areas of my project, though.
  • Somewhat similar question (without an answer): Android Studio - disable errors highlighting for excluded files
2 Answers

After doing some further research I come to conclusion that these errors are not from Android Studio itself but there are plugins for markdown format like Markdown Navigator and Markdown Support if any of them is installed and enabled then you will see above errors in README.md file.

I think this spell check is built in feature of these plugins and can not be controlled from Android Studio.

One option what I think is to disable these plugins and you are good to go.

You can disable these plugins from (Android Studio 3.1.4 MacOS) Preferences > Plugins (or File > Settings > Plugins in Linux) by unchecking them and restart (don't forget it) your Android Studio:

enter image description here

First you need to create a scope (Settings->Scope) and add the files you want to keep out of scope for the Lints you wanna suppress.

Then go to Settings->Inspections, chose the inspection you wanna remove, and then on the right choose from the drop down your scope to define the wanted behavior.

scope_behavior

In this case, my scope is called AVOID_LINTS, and won't show any typo warnings.

EDIT

In the first step, when you create the scope, you need to add your README to the new scope.

EDIT2

Where to find the scopes: enter image description here

You may search for the files you want to add, select and click include.

Related