I am trying to search TFS 2018 using code search feature for some text (.NET version in this case) in all config files for a given project or path but it only works without path: or proj: scope returning results from entire repository.
For example NETFramework,Version=v ext:config returns results for all config files in entire repository as expected but if I add a path: or proj: scope as well or even remove ext: scope and use only path: or proj: nothing is returned.
Given folder structure similar to this $/Root/A001/Sandbox/user/ProjName how can you use path: or proj: scope to search only within ProjName folder?
None of the code search examples combine scopes. Is that even possible?
Here is some of the stuff I tried and none of it works:
NETFramework,Version=v ext:config path:Root/A001/Sandbox/user/ProjName
NETFramework,Version=v ext:config path:$/Root/A001/Sandbox/user/ProjName
NETFramework,Version=v ext:config path:A001/Sandbox/user/ProjName
NETFramework,Version=v ext:config proj:ProjName
NETFramework,Version=v path:Root/A001/Sandbox/user/ProjName
Related
I have quite a large API with many wheels turning. Documenting all of these in one giant openapi.yaml file isn't easy for me so I decided to breakdown the docs to separate paths as shown in the screenshot below:
Now in my customer.yaml file I have the following routes:
/customers/new:
/customers/login:
/customers/logout:
And in my partner.yaml file I have the following routes:
/partners/new:
/partners/login:
/partners/logout:
Now I included the above two files into my final index.yaml file as below
paths:
- $ref: "./paths/partner.yaml"
- $ref: "./paths/customer.yaml"
But the final generated doc by the swagger-cli is adding the - character before the path references thereby resulting in a malformed unusable document.
How can I resolve this?
paths in OpenAPI is a map, not an array, so you can't use the yaml - syntax.
You need to include the pathItem keys in your top level file, and put the $refs to the relevant file or fragment of a file there.
For example:
paths:
/foo:
$ref: "./foo.yaml"
/bar:
$ref: "./paths.yaml#/paths/bar"
I am trying to exclude all generated files from a package using the following analysis_options.yaml file.
include: package:pedantic/analysis_options.yaml
analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
exclude:
- lib/**.g.dart
I still get errors for a file called lib/store/state/presentations_state.g.dart breaking the rule implicit_dynamic_parameter. If I exlcude **.g.dart without the lib/ prefix, dartanalyzer works properly, but the dart-code.dart-code VS Code plugin reports Undefined alias. dart(parse_error) somewhere in the first line of the YAML file, leaving the whole project marked as having an error.
I could reproduce this in both monorepos having multiple packages and single packages as well.
I put the following to the analysis_options.yaml which worked for me:
analyzer:
exclude:
- '**.freezed.dart'
- '**.g.dart'
- '**.gr.dart'
- '**/generated_plugin_registrant.dart'
All files matching the patterns are no longer analysed, independent of its location in the file path.
The quotation marks are necessary to prevent syntax errors in the yaml
See https://github.com/dart-lang/source_gen/tree/master/source_gen#configuring-combining_builder-ignore_for_file
Assuming the generator you use is based on package:source_gen you can use this trick to create the right ignores in the generated file!
https://github.com/kevmoo/peanut.dart/commit/9877105daecf59b8f5eb25431ac691a38a3e636c
https://github.com/kevmoo/stats/commit/bb2fefaa22fc11c10acfe2f6418b3abba1e51909
https://github.com/kevmoo/build_cli/commit/619495c91caab873c2f48ac36a941c893d9b86b7
I have to merge 2 yaml files. The structure of both yaml files is almost same. While merging i have to add comments after each leaf element in the merged yaml that it came from which parent yaml.
I have successfully merged both yaml files, but couldn't find a solution on how to add comments in the merged yaml that it came from which file.
I merged them by reading them as maps in groovy with readyaml and then recursively merging both maps and then converting the result yaml back to yaml
Eg :
a.yaml
id: a_yaml
some_key:
key: value_1
b.yaml
id: b_yaml
some_key:
key: value_2
Now b.yaml has more priority, so merged yaml
id: b_yaml #This came from b_yaml
some_key:
key: value_2 #This came from b_yaml
Now i was able to merge them successfully, but don't know how to add comments in the merged.yaml
I'm trying to import a new version of a udeploy component through Jenkins and the uDeploy plugin that comes from a Git repository and has the .git folder in it. Everything I've tried to exclude the .git folder from syncing doesn't work. I'm thinking that the plugin is looking for files with a .git extension rather than folder. How do I exclude the .git folder form syncing?
I tried ".git", **/.git/, *.git/*, **.git/*, and a handful of other 'terms' and they all show up in the console output as:
Working Directory: C:\Program Files (x86)\Jenkins\jobs\DIT Com\workspace
Includes: **/
Excludes: ".git" Uploading files in C:\Program Files (x86)\Jenkins\jobs\DIT Com\workspace Uploading: .git/hooks/pre-commit.sample
...
Uploading: .git/refs/heads Files committed Finished: SUCCESS
This is what the exclude section looks like, with the help bubble clicked (that's what's in the gray box)
Unable to comment so adding as an answer-
Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning:
A leading "**" followed by a slash means match in all directories. For example, "**/foo" matches file or directory "foo" anywhere, the same as pattern "foo". "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo".
A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.
A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
Other consecutive asterisks are considered invalid.
Have you tried a regular expression? say, ^/.*/.git/
Looks like the answer to excluding directories is in the form of **/dir_name/**.
If someone could give some more information on what the leading *'s are doing (not sure how the second * wildcard interacts, nor the trailing second *) I would be really interested in understanding why it works!
reference: ant fileset dir exclude certain directory
In my standard Symfony2-app I'm having a bunch of bundles with some entities. Some of these entities are not located in the standard folder the automapping of doctrine finds out (e.g. /src/Acme/DemoBundle/Entities) but in a different location.
I could easily use config.yml to tell doctrine to use a different location like this:
doctrine:
orm:
auto_mapping: false
mappings:
AcmeDemoBundle:
type: annotation
prefix: Acme\DemoBundle\Entities\
dir: %kernel.cache_dir%\Acme\DemoBundle\Entities
This works. But say I'm having 10 bundles with a different mapping the config.yml gets bloated very fast. Is there another way, e.g. with a CompilerPass or via DependencyInjection, so I don't need to add all entities in my config.yml? I already looked into the DoctrineBundle, but had no luck so far.
To answer myself:
the most simple way is to adjust the autoloading, there is no need to modify the settings. In Symfony's standard distribution in autoload.php you have to add another location to the registerNamespace-method:
$loader->registerNamespaces(array(
[...]
'Foo' => array(__DIR__.'/../src/dirA', __DIR__.'/../src/dirB')
));
Doctrine will then look for entities in the "Foo" namespace first in dirA and then in dirB if not found.
You can include other configuration files using imports
# yaml
imports:
- { resource: entities.yml }
<!-- xml -->
<imports>
<import resource="enditites.xml" />
</imports>
// PHP
$loader->import('entities.php');
You don't even have to stick to a single file type. It's possible to import an xml configuration file to a yaml file, for example.