2

When I push code for a new feature, Super-Linter checks the entire code. If there are any violations, I need to check the GitHub PR page, which can be quite annoying. I want to be able to know about these violations before pushing to the remote branch.

When using PyCharm, is it possible to know about these lint violations in real-time, similar to the way Pylint warnings are underlined?

And if this isn't possible, are there any other methods available, such as running Super-Linter locally or using some plugins?

I have tried adding Super-Linter as an external tool in PyCharm, but it doesn't seem to work.

Andreas Violaris
  • 2,465
  • 5
  • 13
  • 26
  • 1
    Git hooks. Typically one would have precommit hook to prevent even committing to local branch if linting fails. – rasjani Apr 21 '23 at 07:58

1 Answers1

3

To utilize Super-Linter locally, you can use Docker. Assuming your project is located at C:\projects\projectname, you can execute a command like the following:

docker run --rm -e RUN_LOCAL=true -v C:/projects/projectname:/tmp/lint github/super-linter

Make sure to modify the environmental variables as needed to meet your specific requirements.


Indicative output:

2023-04-21 10:08:44 [INFO]   File:[/tmp/lint/app/static/js/buttons.js]
------
/tmp/lint/app/static/js/buttons.js:6:1: Expected an assignment or function call and instead saw an expression. (no-unused-expressions)
/tmp/lint/app/static/js/buttons.js:6:2: Wrap an immediate function invocation in parentheses. (wrap-iife)

2023-04-21 09:47:25 [ERROR]   ERRORS FOUND in CSS:[3]
2023-04-21 09:47:25 [ERROR]   ERRORS FOUND in DOCKERFILE_HADOLINT:[1]
2023-04-21 09:47:25 [ERROR]   ERRORS FOUND in GITHUB_ACTIONS:[2]
2023-04-21 09:47:25 [ERROR]   ERRORS FOUND in HTML:[1]
2023-04-21 09:47:25 [ERROR]   ERRORS FOUND in JAVASCRIPT_STANDARD:[1]
2023-04-21 09:47:25 [ERROR]   ERRORS FOUND in MARKDOWN:[3]
2023-04-21 09:47:25 [ERROR]   ERRORS FOUND in PYTHON_BLACK:[3]
2023-04-21 09:47:26 [ERROR]   ERRORS FOUND in PYTHON_ISORT:[3]
2023-04-21 09:47:26 [ERROR]   ERRORS FOUND in YAML:[6]
2023-04-21 09:47:26 [FATAL]   Exiting with errors found!
Andreas Violaris
  • 2,465
  • 5
  • 13
  • 26