Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(libs): apply code formatting #2051

Merged
merged 1 commit into from
Sep 11, 2024
Merged

chore(libs): apply code formatting #2051

merged 1 commit into from
Sep 11, 2024

Conversation

poiana
Copy link
Contributor

@poiana poiana commented Sep 10, 2024

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind cleanup

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

This applies code linting/formatting to the entire codebase of the libs

Which issue(s) this PR fixes:

Fixes #381

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Poiana <poiana.bot@gmail.com>
Copy link

github-actions bot commented Sep 10, 2024

Please double check driver/SCHEMA_VERSION file. See versioning.

/hold

Copy link

Perf diff from master - unit tests

    10.36%     +1.14%  [.] sinsp_parser::reset
     4.85%     -0.82%  [.] sinsp_parser::process_event
     0.66%     +0.70%  [.] scap_event_encode_params_v
     1.43%     +0.61%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release
     1.43%     -0.56%  [.] sinsp_utils::find_longest_matching_evt_param
     5.91%     +0.56%  [.] sinsp::next
     0.97%     +0.51%  [.] 0x00000000000e93c0
     3.28%     -0.44%  [.] sinsp_thread_manager::find_thread
     0.28%     +0.43%  [.] copy_and_sanitize_path
     0.84%     -0.40%  [.] thread_group_info::get_first_thread

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            +0.0383         +0.0383           146           151           146           151
BM_sinsp_split_median                                          +0.0403         +0.0403           145           151           145           151
BM_sinsp_split_stddev                                          -0.0785         -0.0789             1             1             1             1
BM_sinsp_split_cv                                              -0.1125         -0.1129             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0279         +0.0279            42            44            42            44
BM_sinsp_concatenate_paths_relative_path_median                +0.0130         +0.0130            42            43            42            43
BM_sinsp_concatenate_paths_relative_path_stddev                +4.2926         +4.2919             0             2             0             2
BM_sinsp_concatenate_paths_relative_path_cv                    +4.1489         +4.1482             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0037         -0.0037            17            17            17            17
BM_sinsp_concatenate_paths_empty_path_median                   -0.0026         -0.0026            17            17            17            17
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.2213         -0.2212             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.2184         -0.2183             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.1072         +0.1072            44            48            44            48
BM_sinsp_concatenate_paths_absolute_path_median                +0.1084         +0.1084            43            48            43            48
BM_sinsp_concatenate_paths_absolute_path_stddev                +0.2680         +0.2683             1             1             1             1
BM_sinsp_concatenate_paths_absolute_path_cv                    +0.1453         +0.1456             0             0             0             0
BM_sinsp_split_container_image_mean                            +0.0109         +0.0109           346           349           346           349
BM_sinsp_split_container_image_median                          +0.0098         +0.0098           345           349           345           349
BM_sinsp_split_container_image_stddev                          +1.0470         +1.0502             2             3             2             3
BM_sinsp_split_container_image_cv                              +1.0250         +1.0281             0             0             0             0

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.57%. Comparing base (dd16507) to head (1bb02f6).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2051      +/-   ##
==========================================
- Coverage   74.10%   73.57%   -0.53%     
==========================================
  Files         254      253       -1     
  Lines       31213    31860     +647     
  Branches     5435     5631     +196     
==========================================
+ Hits        23130    23442     +312     
- Misses       8076     8393     +317     
- Partials        7       25      +18     
Flag Coverage Δ
libsinsp 73.57% <ø> (-0.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Andreagit97
Copy link
Member

Ok after several manual runs the job Format code / format code 🐲 seems to work fine, we should be ready!

@FedeDP
Copy link
Contributor

FedeDP commented Sep 10, 2024

I added the

Fixes #381

;)

@Andreagit97
Copy link
Member

I still cannot believe this is really happening

@Andreagit97 Andreagit97 added this to the 0.18.0 milestone Sep 10, 2024
Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor Author

poiana commented Sep 10, 2024

LGTM label has been added.

Git tree hash: 112ee3ebfbaf6151e8f670d65dd46d7fecf48b28

@Andreagit97
Copy link
Member

@falcosecurity/libs-maintainers please note that from now on all the PRs will need a rebase on master.

Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go!
/approve

@Andreagit97
Copy link
Member

Before merging the PR I would like to see if we are all on board with the new code format @falcosecurity/libs-maintainers
Please note that it would be great to have this not open for a long time since it blocks all the other PRs, but at least let's wait until tomorrow

/hold

Copy link

X64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-4.19 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2-5.10 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2023-6.1 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.0 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.7 🟢 🟢 🟢 🟢 🟢 🟢
centos-3.10 🟢 🟢 🟢 🟡 🟡 🟡
centos-4.18 🟢 🟢 🟢 🟢 🟢 🟢
centos-5.14 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.17 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.8 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-3.10 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-4.14 🟢 🟢 🟢 🟢 🟢 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-5.4 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-4.15 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-5.8 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

ARM64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-4.14 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

@Andreagit97
Copy link
Member

For every one using vs code i suggest the following:

	"editor.formatOnSave": true,
	"cmakeFormat.exePath": "<your-path>",
	"clang-format.executable": "<your-path>"

Copy link
Contributor

@Molter73 Molter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

It'll be great to have consistent formatting across the repo (though I'm not looking forward to all the conflict resolutions I'll have to do 😅 ).

Thanks for doing this!

@poiana
Copy link
Contributor Author

poiana commented Sep 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, Molter73, poiana

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,Molter73]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@FedeDP
Copy link
Contributor

FedeDP commented Sep 11, 2024

/unhold
Let's go!

@poiana poiana merged commit 215db2d into master Sep 11, 2024
58 of 60 checks passed
@poiana poiana deleted the poiana-code-formatting branch September 11, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment