Disable SwiftLint for XCode autogenerated Siri Intents swift files - swiftlint

How to disable SwiftLint for XCode autogenerated *.swift files?
For example for Siri Intents?

You can specify folders and files in the excluded section of the .swiftlint.yml file as discussed in the documentation.
E.g., you might have an excluded section like so:
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- Source/ExcludedFolder
- Source/ExcludedFile.swift
- Source/*/ExcludedFile.swift # Exclude files with a wildcard

Related

disable prettier plugin for specific directory

In my typescript & svelte project, I use prettier to format codes.
Also, I use prettier-plugin-organize-imports to automatically organize imports.
However, this plugin does not support svelte yet (it kind of works, but it's buggy), so I want to disable the plugin for *.svelte files while enabling it for *.ts files.
According to the official doc of prettier, it seems impossible to do this by adding options to config file (prettier.config.js).
Is there a good way?
You can create a .prettierignore to exclude files from formatting.
# Ignore artifacts:
build
coverage
# Ignore all HTML files:
*.html
Check the docs.

SwiftLint cannot exclude the nested files

I try to exclude all the unit test files. But it does not work. Does SwiftLint support nested exclude?
- Pods
- Carthage
- ".*Tests.swift"
# Errors
force_try: warning #All errors occur in Nimble pod, this can be ignored
force_cast:
severity: warning
excluded:
- "*Tests.swift"
You can include folder path in the excluded path section, For nested file workaround, try keeping it in a single folder to exclude the files or mention them in exclude file section.
For Example
excluded: # paths to ignore during linting. Takes precedence over `included`.
- pH7-DriverTests
- pH7-DriverUITests
- Pods
Example:- project's Test & UITest folder name is 'pH7-DriverTest' and 'pH7-DriverUITest' and it contains in source folder.

How can I use scope to search in WebStorm but still exclude node_modules?

I am using WebStorm 2018.2.6
I want to be able to exclude a few folders and file extensions from my searches (when using 'Find in Path'). I set up some scopes to do this, but when I use them, it includes node_modules.
Node_modules are marked as excluded in the Project window. Node_modules is not selectable in the scopes builder. I have typed in the path as I know it but the search still does not exclude it.
If I select 'In Project' instead of 'Scope' when searching, it works as desired but it doesn't allow me to exclude other files I'd like to exclude.
Is there a way to do this?
The problem is that node_modules are only partially excluded - direct dependencies listed in package.json are added to JavaScript libraries and thus included.
To exclude node_modules completely, use In Project scope for searching. JavaScript libraries are only included when using Directory scope with corresponding folder selected, or when using custom scope with explicit filters. Note that excluding libraries from custom scope is a bit tricky... To make it work, you need to prefix your scope pattern with file[your_project_name]:*/&& to overwrite the default scope - see https://youtrack.jetbrains.com/issue/IDEA-145142#comment=27-1156171 for explanation
Related feature request: IDEA-103560

How to use the exclude_files regex in cpplint?

I am using cpplint to check my sourcode agains the google style guide.
Cpplint's help says:
cpplint.py supports per-directory configurations specified in CPPLINT.cfg
files. CPPLINT.cfg file can contain a number of key=value pairs.
Currently the following options are supported:
"exclude_files" allows to specify a regular expression to be matched against
a file name. If the expression matches, the file is skipped and not run
through liner.
Example file:
filter=-build/include_order,+build/include_alpha
exclude_files=.*\.cc
The above example disables build/include_order warning and enables
build/include_alpha as well as excludes all .cc from being
processed by linter, in the current directory (where the .cfg
file is located) and all sub-directories.
How I use cpplint:
I use cpplint by this command to check all files in my source folder:
cpplint src/*.c
Well there is one special file foo.cc which must not be checked. So I tried to create a CPPLIN.cfg to use the exclude_files property. My file looks like this:
set noparent
filter=-build/include_dir
exclude_files=foo.cc
Nevertheless foo.cc is still checked.
What I have already tried to do:
I tried exclude_files=/.*\.cc/. This should exclude all files ending with *.cc. Nevertheless all files are still checked.
I tried to remove my filter from the file. This caused more errors than before. So I am now sure that my CPPLINT.cfg file is found by cpplint.
Question:
How to use the exclude_files regex in cpplint correctly?
Turns out apparently that the doc is wrong: exclude_files only excludes files in the same directory as CPPLINT.cfg, not in subdirectories. See https://github.com/google/styleguide/issues/220
So the solution would be to create src/CPPLINT.cfg and put exclude_files=.*\.cc in it.

gitignore to allow obj models but not compiled obj files

So I'm trying to figure out a suitable gitignore for an OpenGL project. I have the standard C++ gitignore.
Now it ignores .objs, for compiled object file, rightfully so.
However, it also ignores models that are of the .obj format and I do want tracked by version control.
How can I have setup the gitignore to ignore .objs, except from the Assets directory?
If the models are .obj, you should be able to just use
*.objs
in your gitignore to ignore compiled object files, while not ignoring .obj files because they will not match that.
If you want to not ignore .objs that are inside of the Assets folder, you can do
# Ignore compiled files
*.objs
# Don't want to ignore .objs files in Assets
!Assets/*.objs
From gitignore documentation:
An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined. Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, "!important!.txt".