lint

VSCode - how to keybind an external command

流过昼夜 提交于 2019-12-05 05:01:49
问题 Im trying to run "puppet-lint -f (currently open file) The Puppet extenstion provides puppet-lint check, but doesnt auto fix any issues, it just gives warnings. How can I add a keyboard shortcut to run "puppet-lint -f" on a file Im currently editing? Thanks 回答1: I don't know anything about the Puppet extension but in general here is how you can bind a shell command to a keychord: Make a task for it (.vscode/tasks.json): { "version": "2.0.0", { "label": "node version", "command": "node", "args

Selector, Layer-list and shape/bitmap in the same xml

烈酒焚心 提交于 2019-12-05 04:01:29
I have this code in an xml inside the drawable folder: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <layer-list> <item> <shape android:shape="rectangle"> <size android:width="90dp" android:height="90dp" /> <solid android:color="#9933CC" /> </shape> </item> <item> <bitmap android:gravity="center" android:src="@drawable/main_achievements_synthesis" /> </item> </layer-list> </item> <item> <layer-list> <item> <shape android:shape="rectangle"> <size android:width="90dp" android:height="90dp" />

Android - set all lint warnings as errors except for certain ones

佐手、 提交于 2019-12-05 02:24:05
I am trying to make my continuous integration fail the build when new lint warnings that aren't in the lint-baseline.xml file are introduced. I want to have all lint warnings treated as errors (so the build is aborted), but I'd like a way to specify certain lint checks to be treated as informational or warning level so that they still appear in the lint results, but don't cause the build to be aborted. Here is an example of basically what I'd like to do (except this doesn't work, the build fails if any non-ignored warnings exist): lintOptions { lintConfig file("lint.xml") baseline file("lint

Exclude files from Android Studio lint spell checker

馋奶兔 提交于 2019-12-05 00:30:05
The Android Studio lint spell checker flags hex codes that look to it like words in certain files that would be better off unchecked, such as values/colors.xml and build/intermediates/dex-cache/cache.xml . How do I tell lint to not spell check certain folders or files? This can be done by using IDE scopes. In Android Studio (at least 3.4) you can configure each inspection per scope. The idea is that you create a scope that contains all files you don't want to be spellchecked, and then switch Spelling inspection off for this scope, but keep it on for everything else. Add a new scope in Settings

Android data binding dependency conflict with the support library

こ雲淡風輕ζ 提交于 2019-12-04 22:40:35
I'm trying to set up data binding in my Android project like so: dataBinding { enabled = true } However, when I add a support library dependency, lint complains: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.1.0, 21.0.3. Examples include 'com.android.support:animated-vector-drawable:25.1.0' and 'com.android.support:support-v4:21.0.3' When I run ./gradlew app:dependencies , I get the following: ... +--- com.android.support:appcompat-v7:25.1.0 | +--- com.android.support:support-annotations:25.1.0 |

Firestore: Invalid package reference in library

依然范特西╮ 提交于 2019-12-04 22:37:28
After updating to com.google.firebase:firebase-firestore:16.0.0 I get the following lint error: Error: Invalid package reference in library; not included in Android: javax.naming.directory. Referenced from io.grpc.internal.DnsNameResolver.JndiResolver. [InvalidPackage] Error: Invalid package reference in library; not included in Android: javax.naming. Referenced from io.grpc.internal.DnsNameResolver.JndiResolver. [InvalidPackage] Seems that the grpc dependency is making lint unhappy. How can I solve this? You can remove this error by setting the following content in a lint.xml file: <?xml

Perl shallow syntax check? ie. do not check syntax of imports

假装没事ソ 提交于 2019-12-04 19:37:23
问题 How can I perform a "shallow" syntax check on perl files. The standard perl -c is useful but it checks the syntax of imports. This is sometimes nice but not great when you work in a code repository and push to a running environment and you have a function defined in the repository but not yet pushed to the running environment. It fails checking a function because the imports reference system paths (ie. use Custom::Project::Lib qw(foo bar baz)). 回答1: It can't practically be done, because

Lint for ColdFusion [closed]

你说的曾经没有我的故事 提交于 2019-12-04 17:05:17
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Is there an equivalent of JSLint for ColdFusion? 回答1: I've not encountered anything particularly lint-like for CF, but there are assorted syntax checkers: CodeCop (riaforge) VarScoper (riaforge) QueryParam Scanner (riaforge) 回答2: There are no online validators that I am aware of for ColdFusion. You can download

Having scss-lint ignore a particular line

删除回忆录丶 提交于 2019-12-04 16:40:57
问题 How do you tell scss-lint to ignore a particular line in a .scss file? i.e. can you do something like this: .example { display: block !important; // sass-lint: ignore } 回答1: Yep, see the docs on disabling linters via source // scss-lint:disable ImportantRule .example { display: block !important; } // scss-lint:enable ImportantRule 回答2: Just adding to steveax's great answer: If it's just for the one line, you can directly add the comment there and it will only affect that very line. For

Error: Expected resource of type styleable [ResourceType] error

僤鯓⒐⒋嵵緔 提交于 2019-12-04 15:15:28
问题 Take a look at this code snippet. I am getting an error with the last line, because I am passing an 'index' instead of a resource. I thought it was a lint issue and tried to suppress it. Then I noticed I am getting this error only when I building for release. It works fine when building for debug. I am totally clueless. Can anyone throw some light into what I am doing wrong. //Get paddingLeft, paddingRight int[] attrsArray = new int[]{ android.R.attr.paddingLeft, // 0 android.R.attr