Seeking Dev Environment Setup Help for edx-platform Linting/Formatting

Hello Dears!

I’m frequently facing linting issues in GitHub Actions. If you could please share your VS Code setup for automated code formatting and linting that complies with edx-platform requirements?

Specifically looking for:

  • VS Code settings (.vscode/settings.json)

  • Pre-commit hooks configuration

  • Python formatter setup (Black, isort configs)

  • Any other automation that helps prevent lint failures

What’s your dev setup that keeps code compliant with edx-platform standards?

Thanks in advance for helping

I don’t have anything configured for this. May be I’m lazy… I just push the code to the PR and see if any pipelines fail. In an ideal world, it would be great if you could run GitHub Actions locally (I think there are projects that allow you do that), but that also has it’s downsides.

My recommendation would be to check what tools are used in the GitHub actions to lint the code, and then check if there is an integration with your editor. Settings for those tools usually are stored in config flies of the project, so you won’t need to configure it.

For example, for linting code written in python edx-platform runs pylint, and the settings are stored in pylintrc and pylintrc_tweaks. I’m certain that VS Code has integration with pylint, and if you enable it for edx-platform, it will help you avoid linting errors.

I also found this doc page which lists all code quality tools that are used by edx-platform. I think if you run pip install -r requirements/edx/development.txt in your venv, you’ll be able to run the checks locally from your terminal (and may be there are integrations with your editor for some or all of them).

2 Likes