Describe the bug
In a repo with two folders (apps) A and B and a workspace containing these, AppSourceCop rules are used on the B folder app.json although activated only for folder A.
To Reproduce
Create a repo with subfolders app and test. Add a workspace and include both folders (and use that workspace of course ;-)).
Activate the AppSourceCop in the app folder only.
_Click somewhere into the test folder and wait._
These are my current settings:
workspace.code-workspace
{
"folders": [
{
"path": "app"
},
{
"path": "test"
}
],
"settings": {
"al.backgroundCodeAnalysis": false,
"al.enableCodeAnalysis": false
}
}
app\.vscode\settings.json
[...]
"al.enableCodeAnalysis": true,
"al.backgroundCodeAnalysis": true,
"al.codeAnalyzers": ["${CodeCop}","${AppSourceCop}","${UICop}"],
"al.ruleSetPath": ".\\.vscode\\AppSourceCop.ruleset.json"
}
test\.vscode\settings.json
[...]
"al.enableCodeAnalysis": false,
"al.backgroundCodeAnalysis": false
}
Expected behavior
The AppSourceCop should not be run for the test folder.
Instead, the AppSourceCop throws errors for the test > app.json

It might take some time until the errors show up.
Versions:
A work around could be to consider having them in 2 different workspaces.
Go ahead and post this to our Ideas forum at https://aka.ms/BusinessCentralideas, or vote up the idea if its already there. We're constantly monitoring top Ideas and will consider them for a future release.
Hi @PooyaKharamesh
I see this as a bug - because if I am setting the CodeCops per folder, they should be working per folder. Having Test app and Main app in separate workspaces is complicating everything and is against what was done to support multiple roots in workspaces (automatic dependency publishing etc.). It is really just possible workaround, shortterm (and if it is workaround, there is bug...).
Please, reconsider this again, because it is really a bug, not feature...
Agree with @kine and @NKarolak
This is most certainly a bug and now how workspaces are to function. There's vs code settings, workspace settings, and project settings. I may have subproject that wouldn't be on app source and thus need that cop disabled.
See #5585
Most helpful comment
Hi @PooyaKharamesh
I see this as a bug - because if I am setting the CodeCops per folder, they should be working per folder. Having Test app and Main app in separate workspaces is complicating everything and is against what was done to support multiple roots in workspaces (automatic dependency publishing etc.). It is really just possible workaround, shortterm (and if it is workaround, there is bug...).
Please, reconsider this again, because it is really a bug, not feature...