Youtube - Lightning Talk Automation and Process to Increase Code Quality - Ira Mykytyn - CppCon 2021

Lightning Talk: Automation and Process to Increase Code Quality - Ira Mykytyn - CppCon 2021

https://youtu.be/QJ5yOsrYJH4

Transcrição

[00:10]

00:10 hi everybody my name is ira and today i would like to share with you how you managed to automate and automate the process of increasing the code quality on our c plus plus linux

[00:26]

00:26 library it's basically a small project it's like 45 000 likes of the code we host it on github so if you have similar uh

[00:39]

00:39 infrastructure like github github access it may be interesting to you uh it starts two years ago when we wanted

[00:48]

Pasted image 20240108234147.png
00:48 to do some serious refactoring of after of our library uh there were like around 1000 warnings we thought we never we were we're going to

[00:59]

00:59 never fix and [Music] we had test coverage at the level like 40 percent which we wanted to decr increase to the level something

[01:11]

01:11 around 80 we wanted to have more stable library because we uh become seeing some crashes random crashes um

[01:24]

01:24 sometimes we wanted we just wanted to sleep peacefully and know that everything is is as much stable as possible and we eventually wanted

[01:37]

01:37 to learn how to write clean code and we wanted to figure out for ourselves what is the quality code for us so the first step what we did was we

[01:51]

Pasted image 20240108234805.png
01:51 we need to pick up some code style we created like some document for pages where we put what we want to do and what we don't want to do in our

[02:03]

02:03 code we created checklist as a reminder for pr authors to follow what before before creating the

[02:12]

02:12 pull request you can see how it looks in the picture and we put it all together into github request template so could easily

[02:23]

Pasted image 20240108234840.png
02:23 refer to it on pr review it's what we did as a first step and the second step we wanted to make it hard to break the rule so

[02:37]

02:37 general like well-known ci integration we added travis to github we added coverage measurement to pr checks we added static analysis to pair checks

[02:51]

02:51 uh two months ago we finally fixed all the one thousand hundred one thousand of warnings and we put it warning

[03:02]

03:02 started taking warning as its error so put warning as an air flag after um all those warnings were fixed and we made it impossible to match it to merge anything to

[03:15]

03:15 master order without pattern all those checks and here actually the point which i want to pay attention to like it's like my recommendation about

[03:27]

Pasted image 20240108234935.png
03:27 the tools which we used so it's our github actions workflow we have three targeted platforms we have a

[03:40]

03:40 test run and coverage generation and which we upload to the coverage to to to the cadet call

[03:49]

Pasted image 20240108235012.png
03:49 and this is actually the tool which i recommend to use um category reports for coverage measurement and another tool is cut as static code

[04:00]

04:00 analysis which we found also very useful on our on our project uh next steps which we plan to take is create c plus plus q with best practices

[04:14]

Pasted image 20240108235023.png
04:14 guide for our team based on different standards we want to add more static analyzers and we want to add sanitizers and wall grind

[04:24]

04:24 ultimate checkups [Music] and the message of all

[04:34]

04:34 all this is don't compromise the quality of your code and this is one of the ways how you can possibly do it if you have a

[04:44]

04:44 pretty small database hosted on github that's it

[04:54]

04:54 [Applause] you
Pasted image 20240108235041.png

Pasted image 20240108235053.png