lint

Having scss-lint ignore a particular line

有些话、适合烂在心里 提交于 2019-12-03 09:49:37
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 } Yep, see the docs on disabling linters via source // scss-lint:disable ImportantRule .example { display: block !important; } // scss-lint:enable ImportantRule 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 instance, consider the following piece of code: .example { display: block !important; // scss-lint:disable

Error: Expected resource of type styleable [ResourceType] error

自作多情 提交于 2019-12-03 09:31:09
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.paddingRight, // 1 }; TypedArray ta = context.obtainStyledAttributes(attrs, attrsArray); if (ta == null) return;

How do I download and install lint?

我是研究僧i 提交于 2019-12-03 06:55:37
问题 Does anyone know how to obtain lint for Mac, Windows, and Linux? sudo port install lint can't find it. 回答1: From the splint FAQ: Splint supports most, but not all, of the C99 extensions to the ANSI C. This implies that splint is alas not the same as lint. I've had personal experience with running splint on pieces of code like this: for (int i; i < 100; i++) /* Run code */ As declaration of a variable inside the for loop header is not permitted until C99, like in this example, splint will

how to avoid “Octal literals are not allowed in strict mode” with createWriteStream

删除回忆录丶 提交于 2019-12-03 06:29:58
问题 I have the following code fs.createWriteStream( fileName, { flags : 'a', encoding : 'utf8', mode : 0644 }); I get a lint error Octal literals are not allowed in strict mode. What is the correct way to do this code so I won't get a lint error? 回答1: I don't have a node installation at hand, but looking at sources it seems that they allow strings as well: mode : '0644' Does it work? 回答2: You can write them like this : mode : parseInt('0644',8) In node and in modern browsers (see compatibility),

Lint-checking tools for Objective-C development [closed]

社会主义新天地 提交于 2019-12-03 06:08:13
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Large projects with multiple developers often result in code that is inconsistent in style. I am looking for a lint -like tool tailored to Objective-C that goes beyond the scope of the Clang Static Analyser and checks for adherence to stylistic conventions; e.g. braces, indentation, comment formatting, declaring variables at the top of functions and so on. I am aware of AnalysisTool , but it doesn't quite do what I'm

How to suppress specific Lint warning for deprecated Android function?

自古美人都是妖i 提交于 2019-12-03 05:22:30
I use a version switch to support older Android versions. int sdk = Build.VERSION.SDK_INT; if (sdk < Build.VERSION_CODES.HONEYCOMB) { ColorDrawable colorDrawable = new ColorDrawable(shapeColor); //noinspection deprecation viewHolder.shape.setBackgroundDrawable(colorDrawable); } else { viewHolder.shape.setColor(shapeColor); } When build the project with Gradle from the command line the following warning is output by Lint: app/src/main/java/com/example/MyApp/CustomListAdapter.java:92: warning: [deprecation] setBackgroundDrawable(Drawable) in View has been deprecated viewHolder.shape

Building a Cocoapod with Swift and dependency on Objective-C framework

那年仲夏 提交于 2019-12-03 05:07:22
I know there are already a few questions on this theme here on SO, but very few have accepted answers, and I don't think I have found the exact same problem as mine. I'm building a Swift pod, and in my code I rely on the Google Maps iOS SDK, which is bundled as a .framework file. The project builds OK in Xcode, however I have troubles publishing the lib to Cocoapods. I managed to have a Podspec file that almost validates using the pod lib lint command. However, now that I've added the Google-Maps-iOS-SDK pod as a dependency in the Podspec file, it fails with the following message: $ pod lib

How can I check (My)SQL statements for syntactical correctness

你离开我真会死。 提交于 2019-12-03 05:03:56
we're currently setting up out integration server and during that process we've set up pre-commit hooks on the SVN so that our developers can't check in files that are syntactically invalid (primarily PHP and XML). We also have a bunch of .sql files (for MySQL) which I'd like to lint as well. Unfortunately, Google didn't turn up anything useful for this task. Any ideas? The commercial version of MySQL Workbench has a syntax checker for MySQL statements, but of course that would only cover the database aspects. See http://mysql.com/products/workbench/ (though I found the factoid in the help

Linting not working when using babel-eslint on Sublime Text 3

岁酱吖の 提交于 2019-12-03 02:40:24
I am trying to get babel-eslint to work on Sublime 3. I have installed: eslint and babel-eslint globally on npm SublimeLinter package on Sublime SublimeLinter-contrib-eslint package on Sublime Also, I have added: "syntax_map": { ... "JavaScript (Babel)": "javascript" } to my SublimeLinter.sublime-settings file. When I run the linter with "parser": "espree" on my .eslintrc file it works fine. But when I change the parser to babel-eslint it stops working. I tried to follow the tutorial here: https://medium.com/@dan_abramov/lint-like-it-s-2015-6987d44c5b48 and I seem to be doing everything

For Android, where do I find a complete list of @SuppressLint valid issue ids

一笑奈何 提交于 2019-12-03 02:17:29
At the moment, I need to ignore a string concatenation warning relative to internationalization, but would like to "learn how to fish" for other specialized warnings in the future. In the tools subfolder from your Android SDK folder, run lint --list Source: http://tools.android.com/tips/lint/suppressing-lint-warnings and scroll down to "Issue Id's" Using the version bundled with android studio 1.5.1 lint --list Valid issue categories: Correctness Correctness:Messages Security Performance Usability:Typography Usability:Icons Usability Accessibility Internationalization Bi-directional Text Valid