Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan committed Nov 22, 2022
1 parent 96aaee0 commit 0779917
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

# [0.5.8] (2022-11-22)

- Fixed an issue where Python Language Server crashes on virtual environment.
- Added XSOAR_LINTER to linters.

# [0.5.7] (2022-11-17)

- Fixed an issue where `mypy` fails to show issues.
Expand Down
9 changes: 9 additions & 0 deletions Templates/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
"--no-pretty",
"--allow-redefinition"
],
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": [
"-E",
"--load-plugins",
"xsoar_level_checker,partner_level_checker,certified_partner_level_checker,community_level_checker,base_checker",
"--disable=all",
"--enable=E9001,W9005,W9011,E9004,E9011,E9002,E9010,W9012,E9012,W9014,W9019,W9013,W9009,W9010,W9017,W9018,E9007,E9005,W9008,W9016,E9003,E9006",
"--ignore=CommonServerPython.py,demistomock.py,CommonServerUserPython.py,conftest.py,.venv,venv"
],
"python.linting.flake8Enabled": true,
"python.defaultInterpreterPath": ".venv/bin/python",
"cSpell.words": [
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "xsoar",
"displayName": "Cortex XSOAR",
"description": "Build, Format, and Validate Cortex XSOAR with ease.",
"version": "0.5.7",
"version": "0.5.8",
"engines": {
"vscode": "^1.54.0"
},
Expand Down
5 changes: 4 additions & 1 deletion src/devEnvs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ async function addPythonPath(): Promise<void>{
if (!contentPath) {
return
}

const pylintPlugins = path.resolve(path.join(contentPath, "..", "demisto_sdk", "demisto_sdk", "commands", "lint", "resources", "pylint_plugins"))
let PYTHONPATH = `${contentPath}/Packs/Base/Scripts/CommonServerPython/:${contentPath}/Tests/demistomock/:`
const apiModules = execSync(`printf '%s:' ${contentPath}/Packs/ApiModules/Scripts/*`).toString().trim()
PYTHONPATH += apiModules
PYTHONPATH += pylintPlugins
const envFilePath = path.join(contentPath, '.env')
if (!await fs.pathExists(envFilePath)) {
fs.createFileSync(envFilePath)
Expand Down Expand Up @@ -448,7 +451,7 @@ export async function openInVirtualenv(dirPath: string): Promise<void> {
createLaunchJson(ymlObject.type, dirPath, filePath, vsCodePath);
createSettings(vsCodePath, dirPath, path.join(dirPath, 'venv', 'bin', 'python'), true);
await addPythonPath()
fs.copySync(path.join(contentPath, '.env'), path.join(dirPath, '.env'))
fs.copySync(path.join(contentPath, '.env'), path.join(packDir, '.env'))

Logger.info('Run lint')
await dsdk.lint(dirPath, false, false, false, true)
Expand Down

0 comments on commit 0779917

Please sign in to comment.