Skip to content

Commit

Permalink
Hotfix/fix status buttons in readme (#277)
Browse files Browse the repository at this point in the history
* Clang Format, Readme Links

- updated readme links
- updated clang format to be used: 20
- ran clang format

* Clang Format YML

- make a workflow to check clang format for me
- updated readme tables again.

* Update clang_format.yml

- use the proper name for the clang-format check. They currently don't have support for 20. But I'll add a PR for it.
  • Loading branch information
carlkidcrypto authored Jan 11, 2025
1 parent ed7f285 commit 01afd4a
Show file tree
Hide file tree
Showing 9 changed files with 455 additions and 431 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Clang-format

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.18.1
with:
source: '../ezsnmp/.'
extensions: 'c,cpp,h,hpp'
clangFormatVersion: 20
12 changes: 9 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@
EzSnmp
=======

|Python Code Style| |Black| |Pull Request Sphinx Docs Check| |PyPI Distributions| |TestPyPI Distributions| |Tests| |License|
|Python Code Style| |Clang-format Code Style| |Black| |Clang-format| |Pull Request Sphinx Docs Check| |PyPI Distributions| |TestPyPI Distributions| |Tests Homebrew| |Tests Native| |License|

.. |Python Code Style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
.. |Clang-format Code Style| image:: https://img.shields.io/badge/code%20style-clang--format-brightgreen.svg
:target: https://clang.llvm.org/docs/ClangFormat.html
.. |Black| image:: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/black.yml/badge.svg
:target: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/black.yml
.. |Clang-format| image:: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/clang_format.yml/badge.svg
:target: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/clang_format.yml
.. |Pull Request Sphinx Docs Check| image:: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/sphinx_build.yml/badge.svg
:target: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/sphinx_build.yml
.. |PyPI Distributions| image:: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/build_and_publish_to_pypi.yml/badge.svg
:target: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/build_and_publish_to_pypi.yml
.. |TestPyPI Distributions| image:: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/build_and_publish_to_test_pypi.yml/badge.svg
:target: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/build_and_publish_to_test_pypi.yml
.. |Tests| image:: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/tests.yml/badge.svg
:target: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/tests.yml
.. |Tests Homebrew| image:: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/tests_homebrew.yml/badge.svg
:target: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/tests_homebrew.yml
.. |Tests Native| image:: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/tests_native.yml/badge.svg
:target: https://github.com/carlkidcrypto/ezsnmp/actions/workflows/tests_native.yml
.. |License| image:: https://img.shields.io/badge/license-BSD-blue.svg
:target: https://github.com/carlkidcrypto/ezsnmp/blob/master/LICENSE

Expand Down
30 changes: 15 additions & 15 deletions ezsnmp/include/datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@

/**
* @brief Structure to represent an SNMP result.
*
* This structure holds the information retrieved from an SNMP operation,
*
* This structure holds the information retrieved from an SNMP operation,
* including the OID, index, type, and value of the retrieved data.
*/
struct Result {
std::string oid = ""; ///< Object Identifier (OID) of the retrieved data.
std::string index = ""; ///< Index of the retrieved data (if applicable).
std::string type = ""; ///< Data type of the retrieved value.
std::string value = ""; ///< Actual value of the retrieved data.
std::string oid = ""; ///< Object Identifier (OID) of the retrieved data.
std::string index = ""; ///< Index of the retrieved data (if applicable).
std::string type = ""; ///< Data type of the retrieved value.
std::string value = ""; ///< Actual value of the retrieved data.

/**
* @brief Converts the Result object to a string representation.
*
* This method generates a human-readable string representation of the
* Result object, including all its members.
*
* @return A string representation of the Result object.
*/
std::string to_string() const;
/**
* @brief Converts the Result object to a string representation.
*
* This method generates a human-readable string representation of the
* Result object, including all its members.
*
* @return A string representation of the Result object.
*/
std::string to_string() const;
};

#endif // DATATYPES_H
7 changes: 3 additions & 4 deletions ezsnmp/include/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @return A string representation of the variable binding.
*/
std::string print_variable_to_string(oid const *objid,
size_t objidlen,
netsnmp_variable_list const *variable);
size_t objidlen,
netsnmp_variable_list const *variable);

/**
* @brief Throws an exception with SNMP session error information.
Expand Down Expand Up @@ -69,7 +69,6 @@ std::unique_ptr<char *[]> create_argv(std::vector<std::string> const &args, int
*/
Result parse_result(std::string const &input);


/**
* @brief Parses multiple SNMP result strings.
*
Expand All @@ -91,7 +90,7 @@ std::vector<Result> parse_results(std::vector<std::string> const &inputs);
* @param context_engine_id_str The context engine ID.
*/
void remove_v3_user_from_cache(std::string const &security_name_str,
std::string const &context_engine_id_str);
std::string const &context_engine_id_str);

/**
* @brief Converts an OID to its string representation.
Expand Down
Loading

0 comments on commit 01afd4a

Please sign in to comment.