Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Add additional pylint arguments field #255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This package will lint your opened Python-files in Atom, using [pylint](https://
## Configuration
* **Executable** Path to your pylint executable. This is useful if you have different versions of pylint for Python 2
and 3 or if you are using a virtualenv. Use `%p` for the current project (no trailing /).
* **Additional Args** Additional arguments that will be passed into
pylint command (like `--load-plugins=pylint_django`).
* **Message Format** Format for Pylint messages where `%m` is the message, `%i` is the numeric message ID (e.g. W0613)
and `%s` is the human-readable message ID (e.g. unused-argument).
* **Python Path** Paths to be added to the `PYTHONPATH` environment variable. Use `%p` for the current project
Expand Down
6 changes: 6 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export default {
this.subscriptions.add(atom.config.observe('linter-pylint.executablePath', (value) => {
this.executablePath = value;
}));
this.subscriptions.add(atom.config.observe('linter-pylint.additionalArgs', (value) => {
this.additionalArgs = value;
}));
this.subscriptions.add(atom.config.observe('linter-pylint.rcFile', (value) => {
this.rcFile = value;
}));
Expand Down Expand Up @@ -141,6 +144,9 @@ export default {
if (this.rcFile !== '') {
args.push(`--rcfile=${fixPathString(this.rcFile, fileDir, projectDir)}`);
}
if (this.additionalArgs !== '') {
args.push(this.additionalArgs);
}
args.push(filePath);

const execOpts = { env, cwd, stream: 'both' };
Expand Down
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "linter-pylint",
"main": "./lib/main.js",
"version": "2.1.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't change the version in a PR, that will be done when releasing an update.

"version": "2.1.2",
"private": true,
"description": "Lint python on the fly, using pylint",
"repository": "https://github.com/AtomLinter/linter-pylint",
Expand All @@ -20,36 +20,42 @@
"description": "Command or full path to pylint. Use %p for current project directory (no trailing /) or %h for current project name.",
"order": 1
},
"additionalArgs": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is automatically translated into a title, currently this would be "Additional Args". Can you change this to additionalArguments ("Additional Arguments")?

"type": "string",
"default": "",
"description": "Additional pylint command arguments (e.g. '--load-plugins=pylint_django').",
"order": 2
},
"pythonPath": {
"type": "string",
"default": "",
"description": "Paths to be added to $PYTHONPATH. Use %p for current project directory or %f for the directory of the current file.",
"order": 1
"order": 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order was being used as more of a priority, please leave the rest of these settings as they were. 2 is fine for the value of your new setting.

},
"rcFile": {
"type": "string",
"default": "",
"description": "Path to pylintrc file. Use %p for the current project directory or %f for the directory of the current file.",
"order": 2
"order": 4
},
"workingDirectory": {
"type": "string",
"default": "%p",
"description": "Directory pylint is run from. Use %p for the current project directory or %f for the directory of the current file.",
"order": 2
"order": 5
},
"messageFormat": {
"type": "string",
"default": "%i %m",
"description": "Format for Pylint messages where %m is the message, %i is the numeric mesasge ID (e.g. W0613) and %s is the human-readable message ID (e.g. unused-argument).",
"order": 2
"order": 6
},
"disableTimeout": {
"title": "Disable Execution Timeout",
"type": "boolean",
"default": false,
"description": "By default processes running longer than 10 seconds will be automatically terminated. Enable this option if you are getting messages about process execution timing out.",
"order": 3
"order": 7
}
},
"providedServices": {
Expand Down Expand Up @@ -93,4 +99,4 @@
"node": true
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave the trailing newline.