How and why I built IGNOREIT - VSCODE EXTENSION
About me
Software Engineer (QA, Frontend, Backend) & DevOps Engineer
The problem I wanted to solve
IGNOREIT was motivated by the need to forestall the incident where developers mistakenly commit files, that are expected to be ignored, to git and pushes the files alongside others to source controls.
For example, committing and pushing a ".env" file that contains AWS secret and key would expose such account to attacks. Hackers might use the data to gain access the AWS console and make use of multiple AWS services in different regions. Thereby causing the account owner to accrue huge debt.
What is IGNOREIT - VSCODE EXTENSION?
IGNOREIT is a very light VSCODE extension that works in a workspace where git has been initialised. It has provision for a user to globally specify the array of files or folders that should always be tracked and ignored in any project being worked on.
After installation, proceed to your VSCODE settings.json file and add a key-value pair like this into the existing object;
"ignoreit.array": [".env", "node_modules", "venv", "report", "coverage"]
Feel free to modify the elements of the array. The elements are the files you wish to always track in all projects, and get them automatically added to a .gitignore file in your project root directory.
- IGNOREIT would help you create a .gitignore file if it does not already exist.
- It will check the project workspace for files that you specified in settings.json ignoreit.array and add the files that are not already in the .gitignore file into it, so that the file/folder would not be committed and pushed to source control.
- If .env file is specified as one of the files to be ignored, and it also exists in the project workspace, IGNOREIT would create a .env.example file which would contain the variables in the ".env" file (leaving out the values).
- IGNOREIT monitor changes in the project workspace. Each time a file is updated, it runs silently in the background.
Tech stack
NodeJS, JavaScript, VSCODE API
Final thoughts and next steps
This VSCODE extension is stable and has no known issue. I hope you enjoy it too ✌🏽
It is available on vscode marketplace https://marketplace.visualstudio.com/items?itemName=marcdomain.ignoreit