Featured
- Get link
- X
- Other Apps
Week 8: Lab 7: Static Analysis Tooling
The Lab
This week I setup some more documentation and code management tools for my link checker project. This lab helped me understand the purpose of the commonly seen vscode folder in projects, linters, and code formatters. After running each of the commands, no real issues came up after testing.
Source Code Formatter
The nice thing about working with GO, is that is has a built in code formatter called gofmt. I setup some documentation on how to use it, and ran it through out my program. I choose this one since it was already built in and ready to use with GO, and that it was the standard for the language. I think it is pretty cool that this formatter has become an example for many other formatters out there like prettier.
Linter
For the linter I used golint. I simply went and installed golint from there supplied command and was able to run the command on my directory. I then added documentation on how to install the linter in my contributing.md file. I choose this linter since it was the default choice for GO.
Editor/IDE Integration
This final part of the lab had me setting up a .vscode folder which contained my settings.json and extensions.json files. The settings file contained all of the vscode settings used within my own development setup. Here I specified the formatter and the linter to be the ones talked about above. After seeing so many projects included the .vscode folder its nice to actually know the purpose of it now. The settings.json file contained all of the most common settings used within GO projects.
Final Thoughts
This lab helped me understand the whole process of using linters and formatters to standardize my code to make it easier for other developers to jump in and contribute. Picking GO for my project really paid off here since GO already had so many built in tools to help with this lab.
Here's the PR: 08e02a7
Thanks,
Matthew Stewardson
- Get link
- X
- Other Apps
Comments
Post a Comment