DEV Community

Cover image for OSD600 - Lab 7 Static analysis tools
strawberries73
strawberries73

Posted on • Edited on

OSD600 - Lab 7 Static analysis tools

This week in Open Source development for Lab 7 we learned about how and why you would want to add helper tools to your project. The objective was to set up a contributing guide and set up tools to ensure that new code that enters your repository is formatted the same and lint free. Eeesh! I did not realize how many bells and whistles you can add to one project. My curiosity was sparked though.

The first thing I needed to do was create my branch from my URL Link-Checker. The second thing I did was create a CONTRIBUTING.md file. The next thing was to set up a source code formatter and I am using JavaScript, so I went with Prettier. I created a .vscode folder that holds settings.json.

Alt Text

After I tested this to make sure it worked, I moved on to the next task. Set up a linter with ESLint. This is especially good for Javascript because we don't always need a semi-colon. Consistency is key.

Alt Text

I tested my code and added some mistakes on purpose to make sure prettier and lint were working. Happy with the results I rebased and squashed my commits and then merged.

I look at it this way. A project is an investment and it's about protecting that investment from looking like a bad reno job. Keep the code pretty.... make sense to me! Order is peace of mind. Um... I'm not OCD at all...

Top comments (0)