Fortytools-Blog mit News zu Gebäudereinigung, Betreuungsdiensten, Alltagshilfe und andere Dienstleistern

Hier finden Sie aktuelle Informationen, Tipps und Tricks rund um Büro, Verwaltung, Einsatzplanung und mehr!

Catch the obvious bugs earlier

Catch the obvious bugs earlier

Of course, everyone has really good test suites, don’t you? So when we use invalid syntax, the test suite will catch it. But there is a better, faster, more thorough way to detect these errors.

We have a build step on our continous integration server that checks all ruby source files in the project for syntax errors in under five seconds. It is run before the test suite. Because the earlier you catch a bug, the lower the costs of fixing it.

If you use git, I also recommend a pre-commit hook that checks all staged ruby source files before you can commit them - so the bugs are caught even earlier.

We achieve this using a small script that integrates the ruby syntax checker (ruby -c) into our workflow at several levels. Without parameters, the script checks all ruby source files in the current directory and its subdirectories recursively and in parallel, using all your cores. This is how it’s used on the CI server.

But the script has two additional modes:

-c : to only check files with unstaged changes
-s : to only check staged files

Use -s for the pre-commit hook. It’s so fast you won’t notice it - and you will never accidentally commit code with invalid syntax again.

Über den Autor

Bewertet mit durchschnittlich
3.7
Sternen von
65
Lesern.

Fortytools für Ihre Branche

No items found.

Testen Sie 30 Tage kostenlos und unverbindlich die smarte Online-Software für Betreuungsdienste und Gebäudereiniger!

Sie können Fortytools 30 Tage kostenlos und unverbindlich testen. Dabei stehen Ihnen alle Funktionen uneingeschränkt zur Verfügung.
Heute kostenlos testen!
Nutzerbewertung: 4,8 von 5 Sternen

Fortytools läuft komplett im Internet-Browser: Keine Software-Installation, keine Probleme mit Updates. Einfach Einloggen und fertig. Von jedem internetfähigen Gerät.

Kostenlos und unverbindlich testen
Professionelle Rechnungen schreiben
Kunden-Daten verwalten
Mitarbeiter-Daten verwalten
Aufgaben- und Terminplanung
Professionelle Angebote schreiben
Einsätze planen und Zeiten erfassen