Von Marlies Hinterleitner auf Donnerstag, 02. Januar 2025
Kategorie: Englisch

How to configure pylintrc for Python Processors in Apache NiFi?

With Pylint you can ensure the quality of your Python projects. You can do manual checks locally or automated in a pipeline. The following article gives a quick explanation of how to achieve excellent code quality with your Apache NiFi Python Processors with just a few steps.

Installing and customizing pylint

To get started, you will need to install pylint using the following command:

pip install pylint
Once installed, you can create a custom configuration file to tailor pylint for your specific needs. Generate the pylintrc file by running:

pylint --generate-rcfile > pylintrc
After generating the file, you can customize it by disabling certain checks in categories like convention, refactor, warning and errors. This does not mean your code is riddled with issues; rather, it helps you adapt the linting process to accommodate the unique structure of Python Processors in Apache NiFi, ensuring you get the best possible code quality within those constraints.

The specific structure of the processors in Apache NiFi makes it necessary to disable the following checks:

TL; DR

​The final part of disabling in pylintrc file looks like this (defaults included):

You can use your configuration with the command 'pylint folder_with_your_processors --rcfile=path/to/your/pylintrc'. 

Do you like to avoid linting errors in your IDE while coding?

​Use the same configuration in your preferred IDE, in Visual Studio Code you could set this in the settings.json.

Do you have questions about Apache NiFi Processors? Talk to us. 😊

Seminarempfehlungen

Kommentare hinterlassen