Is there a way to use Sorbet without adding the # type annotation to every file? - sorbet

I want to start using Sorbet for my Ruby on Rails project, but I've been asked not to add the type annotation to every file.
Is there a way to use Sorbet without adding the annotation?

Sorbet supports --typed-override feature where you can give sorbet a YAML file to specify what files should go into what level: https://github.com/sorbet/sorbet/tree/master/test/cli/override-typed.
srb runner doesn't currently know about it, but there has been chatter in the community about adding support for it: https://sorbet-ruby.slack.com/archives/CHN2L03NH/p1563404308018500
Note that from our experience at Stripe we found that having typed: true sigils in typed files has a lot of value as it allows users to build & verify their expectations on what is typed and what is not.

Related

how to efficiently do the name refactoring in karate framework?

Seems name refactoring not that easy in Karate framework. I tried in both IntelliJ and VSCode
Could you please suggest some workaround for same
Eg: If I am calling a feature file at multiple places and in case I want to rename it I would need to rename explicitly file name wherever it has been used.
Yes this is a limitation of the existing plugins. The official IntelliJ plugin has JSON validation and this feature is planned, but not yet released: https://plugins.jetbrains.com/plugin/19232-karate

Can I use Sorbet without sig in source code?

I would like to use Sorbet in my Ruby projects at work. As I want to make the process as smooth as possible, I'd like to know if it is possible to add static type checking only using RBI files in sorbet folder.
The idea is to avoid adding signatures to the source code, so my colleagues do not complain, then adding signatures in RBI on the side. This way I can start typing and benefiting in my local environment until it is advanced enough.
Thanks
Yes, it's possible for static checking but not for runtime checking. But I think it's enough for your use case

Running load() within Skylark macro

If your project depends on TensorFlow it is recommended that you add...
load("//tensorflow:workspace.bzl", "tf_workspace")
tf_workspace()
...to your WORKSPACE file, which will load all of TF's dependencies.
However, if you look at TensorFlow's workspace.bzl file...
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/workspace.bzl
you can see that it depends on rules from #io_bazel_rules_closure. This means you also have to define this #io_bazel_rules_closure rule in your WORKSPACE file and keep it in sync with TensorFlow, even if you don't need it anywhere else in your project.
Is there a way to add the load() command somehow/somewhere into the tf_workspace() macro?
Thanks!
No, there is no way to add this rule in tf_workspace(), since the skylark rule tf_workspace() defined in https://github.com/tensorflow/tensorflow/blob/master/tensorflow/workspace.bzl needs to load #io_bazel_rules_closure.
There are basically two ways to make this work
either the tensorflow project redefines its rules so that it only uses internal rules or native rules.
or bazel is able to load the workspace of a dependency (and I assume load all the transitive dependencies too). This is a hard problem and is tracked in #1943.

GNU Autotools, what is "*h.in" files?

I am new to autotools, and can't find out where from *.h.in files are created?
I am trying to create small hello_demo for my library, where I include *.h and use it. make throws me error, that *h.in not found.
Any guide how to make it proper way, will be very appreciate)
Assuming you're talking about config.h.in, it is generated by default by autoheader. You should not strictly need it though.
Make sure you're using autoreconf -fis to generate your autotools support files, that will call all the needed tools for the generation to work. I would also point you to my guide for the very minimal code you need to build a project, which does not involve autoheader at all.

C#, Gendarme, Sonar and Jenkins : Exclude generated files from Gendarme

I'm working with gendarme for .net called by Sonar (launched by Jenkins).
I've a lot of AvoidVisibleFieldsRule violations. The main violations are found in the generated files. As I can't do anything on it, i would like to exclude *.designer.cs from the scan.
I can't find a way to do that. There is a properties in Sonar to exclude generated files but it doesn't seem to be applied for gendarme.
Is there a way to do such a thing ?
Thanks for all
Gendarme expects you provide an ignore list,
http://www.mono-project.com/Gendarme.FAQ
https://github.com/mono/mono-tools/blob/master/gendarme/self-test.ignore
The ignore file format is bit of weird, but you can learn it by experiments.
Indeed that is actually not normal at all. Generated code is excluded by the plugin with the standard configuration. What version of the C# plugins are you using ?
Anyway, the configuration property you can try is "sonar.exclusions" (see http://docs.codehaus.org/display/SONAR/Advanced+parameters).
If you do not solve your problem right away, the best thing would be to drop a mail to the user mailing list (see http://www.sonarsource.org/support/support/) and send the verbose output of your build. To get this output simply add "-X" to the command line.
Hope it helps