lint

VSCode - how to keybind an external command

99封情书 提交于 2019-12-03 20:49:40
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 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": [ "-v" ], "type": "shell" } } In the args: you may use ${file} for the current file. Then in keybindings

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

强颜欢笑 提交于 2019-12-03 17:06:48
问题 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 2 years ago . 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

Analyze code with Lint for calls that require permissions

纵然是瞬间 提交于 2019-12-03 15:42:25
I am setting my targetSdkVersion to 23 and therefore I want to implement "Requesting permissions at runtime". (see here ) Lint directly calls out if you forget to check the permission and tells you the following: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission ) or explicitly handle a potential `SecurityException' This is quite nice and I want to analyze my code for any call that I may have forgotten, but I can't find Lint option that I have to select in my Inspection profile. How is the inspection

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

空扰寡人 提交于 2019-12-03 15:29:59
问题 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

Lint-like program for Perl?

末鹿安然 提交于 2019-12-03 15:00:50
问题 I'm looking for a lint for Perl, something that would catch dead code and other potential problems. Any suggestions? I have use strict; use warnings; already but I'd like to have more. 回答1: Perl doesn't have a direct equivalent to lint. A large part of the reason for that is that Perl doesn't provide quite as many ways to hang yourself as C does. The basic version of "lint" for Perl is this: perl -Mstrict [-Mdiagnostics] -cw <file> This causes perl to compile (but not run) the specified file

Android Lint Plugin - set custom warning / error that should be checked

天涯浪子 提交于 2019-12-03 14:25:01
My question is if there is a way to add to lint plugin a custom check which it should warn me about before building a version. For example I want it to check all Cursor, InputStream objects in my code if they are closed, or to check my code for //TODO: , //FIXME: . Any ideas if there is any kind of way to do that, or even not with Lint Plugin? Thanks in advance! Yes, you can add custom checks; see http://tools.android.com/tips/lint/writing-a-lint-check and http://tools.android.com/tips/lint-custom-rules . For your specific question, note that there's a new lint check in 21.1 which looks at

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

邮差的信 提交于 2019-12-03 11:53:33
问题 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. 回答1: 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" 回答2: Using the version bundled with android studio 1.5.1 lint --list Valid issue categories: Correctness Correctness:Messages Security

Writing a R lint program

一曲冷凌霜 提交于 2019-12-03 11:35:57
问题 When I program in python, I find using pylint very useful. However, when I program in R, there is nothing comparable. As a small side project, I thought it would be fun to try and write a small lint program. Nothing too fancy, something along the lines of: Making sure function names are camel case Average function length Detecting unused variables Spacing. For example, function(x=1, y=2) instead of function(x=1,y=2) However, I'm unsure of how to get started (I have started to look through the

How can I get scalac to tell me if I have unused variables?

邮差的信 提交于 2019-12-03 11:19:11
I just noticed a bug in my code where I created a new variable, but then failed to actually use it. I assumed that scalac would have told me that my new variable was unused, but this didn't seem to be the case, and after a small amount of googling / man page, I couldn't find anything about enabling warnings. What can I do to enable such warnings? This stuff was just now discussed on the scala user mailing list. Result of the discussion: It's considererd task of IDE to do that (so far they don't or at least not very exhaustive) The main argument seems to be that the scala compiler is already

Conflicting lint messages regarding paddingStart usage

半腔热情 提交于 2019-12-03 10:29:58
问题 After API 17 / RTL support was released, I added the following to my manifest android:supportsRtl="true" which caused Lint to rightfully give me these warnings wherever I had paddingLeft/Right in my views: Consider adding android:paddingStart="8dp" to better support right-to-left layouts Consider adding android:paddingEnd="8dp" to better support right-to-left layouts I did this following the guidance found in this android-developers blogpost, which implied that we did not need to create a new