coc-pyright 1.1.295 → 1.1.296

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +20 -24
  2. package/package.json +20 -2
package/lib/index.js CHANGED
@@ -97678,7 +97678,12 @@ var Flake8 = class extends BaseLinter {
97678
97678
  }
97679
97679
  async runLinter(document, cancellation) {
97680
97680
  const fsPath = import_coc15.Uri.parse(document.uri).fsPath;
97681
- const args = ["--format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s", "--exit-zero", "--stdin-display-name", fsPath, "-"];
97681
+ const args = ["--format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s", "--exit-zero"];
97682
+ if (this.info.stdinSupport) {
97683
+ args.push("--stdin-display-name", fsPath, "-");
97684
+ } else {
97685
+ args.push(fsPath);
97686
+ }
97682
97687
  const messages = await this.run(args, document, cancellation);
97683
97688
  messages.forEach((msg) => {
97684
97689
  msg.severity = this.parseMessagesSeverity(msg.type, this.pythonSettings.linting.flake8CategorySeverity);
@@ -97692,12 +97697,11 @@ var import_coc16 = require("coc.nvim");
97692
97697
  var path5 = __toESM(require("path"));
97693
97698
  var import_which3 = __toESM(require_which());
97694
97699
  var LinterInfo = class {
97695
- constructor(product, id, configService, stdinSupport = false, configFileNames = []) {
97700
+ constructor(product, id, configService, configFileNames = []) {
97696
97701
  this.configService = configService;
97697
97702
  this._product = product;
97698
97703
  this._id = id;
97699
97704
  this._configFileNames = configFileNames;
97700
- this._stdinSupport = stdinSupport;
97701
97705
  }
97702
97706
  get id() {
97703
97707
  return this._id;
@@ -97705,32 +97709,21 @@ var LinterInfo = class {
97705
97709
  get product() {
97706
97710
  return this._product;
97707
97711
  }
97708
- get pathSettingName() {
97709
- return `${this.id}Path`;
97710
- }
97711
- get argsSettingName() {
97712
- return `${this.id}Args`;
97713
- }
97714
- get enabledSettingName() {
97715
- return `${this.id}Enabled`;
97716
- }
97717
- get configFileNames() {
97718
- return this._configFileNames;
97719
- }
97720
97712
  get stdinSupport() {
97721
- return this._stdinSupport;
97713
+ const settings = this.configService;
97714
+ return settings.linting[`${this.id}Stdin`];
97722
97715
  }
97723
97716
  isEnabled(_resource) {
97724
97717
  const settings = this.configService;
97725
- return settings.linting[this.enabledSettingName];
97718
+ return settings.linting[`${this.id}Enabled`];
97726
97719
  }
97727
97720
  pathName(_resource) {
97728
97721
  const settings = this.configService;
97729
- return settings.linting[this.pathSettingName];
97722
+ return settings.linting[`${this.id}Path`];
97730
97723
  }
97731
97724
  linterArgs(_resource) {
97732
97725
  const settings = this.configService;
97733
- const args = settings.linting[this.argsSettingName];
97726
+ const args = settings.linting[`${this.id}Args`];
97734
97727
  return Array.isArray(args) ? args : [];
97735
97728
  }
97736
97729
  getExecutionInfo(customArgs, resource) {
@@ -97918,8 +97911,11 @@ var Pylint = class extends BaseLinter {
97918
97911
  super(info, outputChannel);
97919
97912
  }
97920
97913
  async runLinter(document, cancellation) {
97921
- const fsPath = import_coc23.Uri.parse(document.uri).fsPath;
97922
- const args = ["--msg-template='{line},{column},{category},{symbol}:{msg}'", "--exit-zero", "--reports=n", "--output-format=text", "--from-stdin", fsPath];
97914
+ const args = ["--msg-template='{line},{column},{category},{symbol}:{msg}'", "--exit-zero", "--reports=n", "--output-format=text"];
97915
+ if (this.info.stdinSupport) {
97916
+ args.push("--from-stdin");
97917
+ }
97918
+ args.push(import_coc23.Uri.parse(document.uri).fsPath);
97923
97919
  const messages = await this.run(args, document, cancellation, REGEX5);
97924
97920
  messages.forEach((msg) => {
97925
97921
  msg.severity = this.parseMessagesSeverity(msg.type, this.pythonSettings.linting.pylintCategorySeverity);
@@ -98115,8 +98111,8 @@ var LintingEngine = class {
98115
98111
  this.configService = PythonSettings.getInstance();
98116
98112
  this.linters = [
98117
98113
  new LinterInfo(8 /* bandit */, "bandit", this.configService),
98118
- new LinterInfo(2 /* flake8 */, "flake8", this.configService, true),
98119
- new LinterInfo(1 /* pylint */, "pylint", this.configService, true, [".pylintrc", "pylintrc"]),
98114
+ new LinterInfo(2 /* flake8 */, "flake8", this.configService),
98115
+ new LinterInfo(1 /* pylint */, "pylint", this.configService, [".pylintrc", "pylintrc"]),
98120
98116
  new LinterInfo(7 /* mypy */, "mypy", this.configService),
98121
98117
  new LinterInfo(3 /* pycodestyle */, "pycodestyle", this.configService),
98122
98118
  new LinterInfo(5 /* prospector */, "prospector", this.configService),
@@ -98124,7 +98120,7 @@ var LintingEngine = class {
98124
98120
  new LinterInfo(16 /* pyflakes */, "pyflakes", this.configService),
98125
98121
  new LinterInfo(4 /* pylama */, "pylama", this.configService),
98126
98122
  new LinterInfo(9 /* pytype */, "pytype", this.configService),
98127
- new LinterInfo(17 /* ruff */, "ruff", this.configService, true)
98123
+ new LinterInfo(17 /* ruff */, "ruff", this.configService)
98128
98124
  ];
98129
98125
  }
98130
98126
  get diagnostics() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-pyright",
3
- "version": "1.1.295",
3
+ "version": "1.1.296",
4
4
  "description": "Pyright extension for coc.nvim, static type checker for Python",
5
5
  "author": "Heyward Fann <fannheyward@gmail.com>",
6
6
  "license": "MIT",
@@ -943,6 +943,12 @@
943
943
  "description": "Whether to lint Python files using flake8",
944
944
  "scope": "resource"
945
945
  },
946
+ "python.linting.flake8Stdin": {
947
+ "type": "boolean",
948
+ "default": false,
949
+ "description": "Whether to run flake8 via stdin.",
950
+ "scope": "resource"
951
+ },
946
952
  "python.linting.flake8Path": {
947
953
  "type": "string",
948
954
  "default": "flake8",
@@ -1170,6 +1176,12 @@
1170
1176
  "description": "Whether to lint Python files using ruff.",
1171
1177
  "scope": "resource"
1172
1178
  },
1179
+ "python.linting.ruffStdin": {
1180
+ "type": "boolean",
1181
+ "default": true,
1182
+ "description": "Whether to run ruff via stdin.",
1183
+ "scope": "resource"
1184
+ },
1173
1185
  "python.linting.ruffPath": {
1174
1186
  "type": "string",
1175
1187
  "default": "ruff",
@@ -1275,6 +1287,12 @@
1275
1287
  ],
1276
1288
  "scope": "resource"
1277
1289
  },
1290
+ "python.linting.pylintStdin": {
1291
+ "type": "boolean",
1292
+ "default": false,
1293
+ "description": "Whether to run pylint via stdin.",
1294
+ "scope": "resource"
1295
+ },
1278
1296
  "python.linting.pylintEnabled": {
1279
1297
  "type": "boolean",
1280
1298
  "default": false,
@@ -1537,6 +1555,6 @@
1537
1555
  ]
1538
1556
  },
1539
1557
  "dependencies": {
1540
- "pyright": "^1.1.295"
1558
+ "pyright": "^1.1.296"
1541
1559
  }
1542
1560
  }