Skip to content

fixes#130

Draft
klement wants to merge 7 commits intoclicon:masterfrom
klement:fixes
Draft

fixes#130
klement wants to merge 7 commits intoclicon:masterfrom
klement:fixes

Conversation

@klement
Copy link
Contributor

@klement klement commented Apr 6, 2025

  • Improve type safety
  • Proper inet_ntop return value check.
  • Replace non-standard FUNCTION with C99+ standard func
  • Fix return value check
  • Remove invalid structure
  • Improve type safety
  • Add -Wpendantic

klement added 5 commits April 3, 2025 17:59
cvec_append_var returns a pointer, so a NULL check is appropriate
C spec 6.2.5-20 says that a structure cannot be zero size:

A structure type describes a sequentially allocated nonempty set of member objects
(and, in certain circumstances, an incomplete array), each of which has an optionally
specified name and possibly distinct type.

Commenting it out doesn't seem to break anything build-wise.
@codecov
Copy link

codecov bot commented Apr 6, 2025

Codecov Report

Attention: Patch coverage is 30.35714% with 39 lines in your changes missing coverage. Please review.

Project coverage is 53.23%. Comparing base (63993b3) to head (d1ba787).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cligen_expand.c 0.00% 8 Missing ⚠️
cligen_read.c 0.00% 8 Missing ⚠️
cligen_handle.c 0.00% 5 Missing ⚠️
cligen_cv.c 20.00% 2 Missing and 2 partials ⚠️
cligen_print.c 50.00% 4 Missing ⚠️
cligen_cvec.c 0.00% 2 Missing ⚠️
cligen_syntax.c 0.00% 2 Missing ⚠️
cligen_getline.c 75.00% 1 Missing ⚠️
cligen_history.c 88.88% 1 Missing ⚠️
cligen_match.c 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #130      +/-   ##
==========================================
- Coverage   53.28%   53.23%   -0.05%     
==========================================
  Files          23       23              
  Lines        7725     7730       +5     
  Branches     1782     1784       +2     
==========================================
- Hits         4116     4115       -1     
- Misses       2588     2592       +4     
- Partials     1021     1023       +2     
Files with missing lines Coverage Δ
cligen_buf.c 37.50% <ø> (ø)
cligen_hello.c 57.69% <ø> (ø)
cligen_getline.c 55.94% <75.00%> (ø)
cligen_history.c 49.00% <88.88%> (ø)
cligen_match.c 66.66% <0.00%> (ø)
cligen_object.c 53.46% <0.00%> (ø)
cligen_parse.l 65.54% <50.00%> (+0.29%) ⬆️
cligen_parsetree.c 37.39% <0.00%> (ø)
cligen_cvec.c 55.14% <0.00%> (ø)
cligen_syntax.c 34.31% <0.00%> (ø)
... and 5 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63993b3...d1ba787. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@olofhagsand olofhagsand left a comment

Choose a reason for hiding this comment

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

Seems -Wpedantic made codecov error whichin turn failed github actions.
Not OK to fail github actions.
Commen: the codecov action is not that important, it used to be a part of a more complete cligen+clixon coverage, the remaining part is just a subset of the complete task, which means it could be safely remove.

cligen_history.c Outdated
int
hist_add(cligen_handle h,
char *buf)
const char *buf)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a way to invoke linter or do you spot these manually?
I don't see a .clang-format (nor .clang-tidy) - it would be great to have these.

@klement klement marked this pull request as draft April 7, 2025 10:04
klement added 2 commits April 7, 2025 13:30
Make strings which are not expected to be modified const. Fix violations.
Add -Wwrite-strings to enforce future good behaviour.
Add an explicit cast where it would cause an unnecessary warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants