Title: Cannot override linter options per project · Issue #1158 · python-mode/python-mode · GitHub
Open Graph Title: Cannot override linter options per project · Issue #1158 · python-mode/python-mode
X Title: Cannot override linter options per project · Issue #1158 · python-mode/python-mode
Description: The following code prevents us from overriding the linter options per project. python-mode/pymode/lint.py Lines 52 to 57 in 85d2cd1 for linter in linters: opts = env.var('g:pymode_lint_options_%s' % linter, silence=True) if opts: options...
Open Graph Description: The following code prevents us from overriding the linter options per project. python-mode/pymode/lint.py Lines 52 to 57 in 85d2cd1 for linter in linters: opts = env.var('g:pymode_lint_options_%s' ...
X Description: The following code prevents us from overriding the linter options per project. python-mode/pymode/lint.py Lines 52 to 57 in 85d2cd1 for linter in linters: opts = env.var('g:pymode_lint_options_...
Opengraph URL: https://github.com/python-mode/python-mode/issues/1158
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot override linter options per project","articleBody":"The following code prevents us from overriding the linter options per project.\r\n \r\nhttps://github.com/python-mode/python-mode/blob/85d2cd1a196ac1def79d4599b5be69395ed5b603/pymode/lint.py#L52-L57\r\n\r\nHere is what the pymode logs show (I have added some log line 53 to see what is set globally):\r\n\r\n```\r\npymode debug msg 9: check code\r\n1661433148 ['pyflakes', 'pep8'] []\r\n1661433148 Namespace(paths=['/tmp/bla'], verbose=False, format='pycodestyle', select=[], sort=[], linters=[('pyflakes', \u003cpylama.lint.pylama_pyflakes.Linter object at 0x7f177ab71870>), ('pep8', \u003cpylama.lint.pylama_pycodestyle.Linter object\r\nat 0x7f177ab71990>)], ignore=['W'], skip=[], report=None, hook=False, concurrent=False, options='/tmp/bla/pylama.ini', force=True, abspath=False, file_params={}, linters_params={'pep8': {'max_line_length': 101}}) []\r\n1661433148 g:pymode_lint_options_pyflakes -> {'builtins': '_'} []\r\n1661433148 g:pymode_lint_options_pep8 -> {'max_line_length': '79'} []\r\n1661433148 Start code check: [wrong.py]\r\nChecking params: {'skip': False, 'ignore': {'W'}, 'select': set(), 'linters': []} - Namespace(paths=['/tmp/bla'], verbose=False, format='pycodestyle', select=[], sort=[], linters=[('pyflakes', \u003cpylama.lint.pylama_pyflakes.Linter object at\r\n0x7f177ab71870>), ('pep8', \u003cpylama.lint.pylama_pycodestyle.Linter object at 0x7f177ab71990>)], ignore=['W'], skip=[], report=None, hook=False, concurrent=False, options='/tmp/bla/pylama.ini', force=True, abspath=False, file_params={}, lint\r\ners_params={'pep8': {'max_line_length': '79'}, 'pyflakes': {'builtins': '_'}})\r\nRun pyflakes {'builtins': '_'}\r\nRun pep8 {'max_line_length': '79'}\r\n``` \r\n\r\nAs you can see, `pylama` finds its custom settings inside the `pylama.ini` file, but they are then overridden.\r\n\r\nI would have expected the `pylama.ini` settings to override the _global_ ones but it's definitely not the case.\r\n\r\nI'd suggest the code above to be replaced with:\r\n\r\n```python\r\n for linter in linters:\r\n opts = env.var('g:pymode_lint_options_%s' % linter, silence=True)\r\n if opts:\r\n opts_override = options.linters_params.get(linter, {})\r\n options.linters_params[linter] = opts\r\n options.linters_params[linter].update(opts_override)\r\n``` \r\n\r\nI can open a PR if needed","author":{"url":"https://github.com/ziirish","@type":"Person","name":"ziirish"},"datePublished":"2022-08-25T13:33:18Z","url":"https://github.com/python-mode/python-mode/issues/1158"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a1e6c634-b25b-142a-db93-48e7dceaed53 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E38:247D07:6B2376:91F3AB:6AFE66D3 |
| html-safe-nonce | f6a5e9ae33c703012b5cfdec315f121a0a0e3344bc0f9ba53106c3fbe3ddb15d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTM4OjI0N0QwNzo2QjIzNzY6OTFGM0FCOjZBRkU2NkQzIiwidmlzaXRvcl9pZCI6IjgzMTUyNzQxODM5OTQ5MjY4MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 62cd799102721d353924ad3d18d4bb90c46d3e00895ae396953c9e0c4e01e2e3 |
| hovercard-subject-tag | issue:1350909845 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-mode/python-mode/1158/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75db1cefe17ee7526364bf75c40008aadd9e84fb140e77f689d2d0aea82d9b07/python-mode/python-mode/issues/1158 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75db1cefe17ee7526364bf75c40008aadd9e84fb140e77f689d2d0aea82d9b07/python-mode/python-mode/issues/1158 |
| og:image:alt | The following code prevents us from overriding the linter options per project. python-mode/pymode/lint.py Lines 52 to 57 in 85d2cd1 for linter in linters: opts = env.var('g:pymode_lint_options_%s' ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ziirish |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-mode/python-mode git https://github.com/python-mode/python-mode.git |
| octolytics-dimension-user_id | 13965098 |
| octolytics-dimension-user_login | python-mode |
| octolytics-dimension-repository_id | 2408911 |
| octolytics-dimension-repository_nwo | python-mode/python-mode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2408911 |
| octolytics-dimension-repository_network_root_nwo | python-mode/python-mode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width