DEV Community

P-DR0ZD
P-DR0ZD

Posted on • Updated on

Adding a Code Formatter and a Linter to my SSG

This week I for my Static Site Generator I added tools to make sure that Pull requests are formatted with my standards of code.

e22e997

Code Formatter

For the code Formatter i used black because I'm using a python Program. with that i also needed to install poetry. Poetry builds .toml files which python can use to install dependencies like the markdown formatter i added. Instead of adding the files to my code directly i now use the installation script that is inside the .toml file.

With poetry installed i can use black to format one file or an entire directory. Afterwards I integrated it inside of vscode so anyone who has built the project and has black installed can automatically format the code anytime they save.

Code Linter

For the code linter i used Flake8. I added this to my dependencies so it would allow developers to check for small errors inside of the code. After i needed to add a .flake file so it had my configurations.

Top comments (0)