How Would You Enforce Code Static Check? Learn and understand the check tools. Then install and configure them in your servers.
With docker, it could be much easier than ever! Let me show you how. The solution has built-in supports for: Python, Ruby, Shell. (You definitely can add more).
And What Does It Take? 5 minutes. Yes, you hear me. Only 5 minutes!
Check More Discussion In LinkedIn Discussion.
What are the problems with the old way?
- It takes time. We need time to learn and understand the tools. Install them, configure them, or even migrate them across servers. These are all costs.
- It might be tricky and troublesome. Installing extra packages might mean headaches. Upgrading the tools might mean nightmares.
Let’s say you want to install rubocop v0.49.1. And it requires ruby2.4. But your server has already installed ruby2.5 or ruby3. What would you do? Downgrade to 2.4? Are you sure this is a good idea, and it won’t break anything?
Okay, you have downgraded your ruby to 2.4 or even make multiple ruby versions installed(which is tricky). Anyway it’s working. Congratulations!
But two months later, rubocop v1.0.3 has been released. And you want to try it. But you just find out rubocop v1.0.3 requires ruby3.5!
How do you feel now, my friend? (Note you are living a pretty busy life. )
Yes, We Need The Code Check Tools. But Do We Really Have To Install Them In Our Servers?
Here is the new idea:
- Create a temporary docker container. And it has tools installed and configured inside.
- When the container starts, it get source code as docker volumes.
- Inside the container, the test runs.