-
Notifications
You must be signed in to change notification settings - Fork 335
yanglint: Add commands for sample skeleton generation and IETF validation #2531
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
Open
HanzlikPetr
wants to merge
2
commits into
CESNET:devel
Choose a base branch
from
HanzlikPetr:new_yanglint_func
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -276,6 +276,27 @@ int cmd_print_dep(struct yl_opt *yo, int posc); | |
| int cmd_print_exec(struct ly_ctx **ctx, struct yl_opt *yo, const char *posv); | ||
| void cmd_print_help(void); | ||
|
|
||
| /* cmd_sample.c */ | ||
|
|
||
| /** | ||
| * @copydoc cmd_add_opt | ||
| */ | ||
| int cmd_sample_opt(struct yl_opt *yo, const char *cmdline, char ***posv, int *posc); | ||
| /** | ||
| * @copydoc cmd_add_dep | ||
| */ | ||
| int cmd_sample_dep(struct yl_opt *yo, int posc); | ||
| void cmd_sample_help(void); | ||
| /** | ||
| * @brief Print a sample skeleton of module in json or xml. | ||
| * | ||
| * @param[in,out] ctx context for libyang. | ||
| * @param[in] yo context for yanglint. | ||
| * @param[in] posv Name of the module to be printed. | ||
| * @return 0 on success, 1 on failure. | ||
| */ | ||
| int cmd_sample_exec(struct ly_ctx **ctx, struct yl_opt *yo, const char *posv); | ||
|
|
||
| /* cmd_searchpath.c */ | ||
|
|
||
| /** | ||
|
|
@@ -391,4 +412,26 @@ int cmd_debug_store(struct ly_ctx **ctx, struct yl_opt *yo, const char *posv); | |
| int cmd_debug_setlog(struct ly_ctx *ctx, struct yl_opt *yo); | ||
| void cmd_debug_help(void); | ||
|
|
||
| /* cmd_ietf.c */ | ||
| /** | ||
| * @copydoc cmd_add_opt | ||
| */ | ||
| int cmd_ietf_opt(struct yl_opt *yo, const char *cmdline, char ***posv, int *posc); | ||
| /** | ||
| * @copydoc cmd_add_dep | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing a new line. |
||
| */ | ||
| int cmd_ietf_dep(struct yl_opt *yo, int posc); | ||
| void cmd_ietf_help(void); | ||
|
|
||
| /** | ||
| * @brief Execution handler for the 'ietf' command in the yanglint CLI tool. | ||
| * | ||
| * @param[in,out] ctx A double pointer to the libyang context containing the loaded modules. | ||
| * @param[in,out] yo A pointer to the yanglint options structure, which manages global | ||
| * @param[in] posv The positional command-line argument provided by the user, representing the target module name (e.g., "ietf-interfaces" or "ietf-interfaces@2014-05-08"). | ||
| * @return 0 on successful execution of the validation pipeline (note: this returns 0 even if IETF compliance warnings/errors were printed to the output). | ||
| * @return 1 on fatal execution errors (e.g., module not found, module failed to compile, or memory allocation failure). | ||
| */ | ||
| int cmd_ietf_exec(struct ly_ctx **ctx, struct yl_opt *yo, const char *posv); | ||
|
|
||
| #endif /* COMMANDS_H_ */ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a new line.