-
Notifications
You must be signed in to change notification settings - Fork 593
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
DataStorm linter suggested fixes #3293
Merged
Merged
Changes from all commits
Commits
Show all changes
4 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 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 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 |
---|---|---|
|
@@ -264,7 +264,7 @@ namespace DataStorm | |
* | ||
* @return The unread samples. | ||
*/ | ||
std::vector<Sample<Key, Value, UpdateTag>> getAllUnread() noexcept; | ||
[[nodiscard]] std::vector<Sample<Key, Value, UpdateTag>> getAllUnread() noexcept; | ||
|
||
/** | ||
* Wait for given number of unread samples to be available. | ||
|
@@ -286,7 +286,7 @@ namespace DataStorm | |
* @return The unread sample. | ||
* @throws NodeShutdownException If the node is shut down while waiting. | ||
*/ | ||
Sample<Key, Value, UpdateTag> getNextUnread(); | ||
[[nodiscard]] Sample<Key, Value, UpdateTag> getNextUnread(); | ||
|
||
/** | ||
* Calls the given functions to provide the initial set of connected keys and when a key is added or | ||
|
@@ -420,14 +420,14 @@ namespace DataStorm | |
* @return The last written sample. | ||
* @throws std::logic_error If there's no sample. | ||
**/ | ||
Sample<Key, Value, UpdateTag> getLast(); | ||
[[nodiscard]] Sample<Key, Value, UpdateTag> getLast(); | ||
|
||
/** | ||
* Get all the written sample kept in the writer history. | ||
* | ||
* @return The sample history. | ||
**/ | ||
std::vector<Sample<Key, Value, UpdateTag>> getAll() noexcept; | ||
[[nodiscard]] std::vector<Sample<Key, Value, UpdateTag>> getAll() noexcept; | ||
|
||
/** | ||
* Calls the given functions to provide the initial set of connected keys and when a key is added or | ||
|
@@ -551,7 +551,7 @@ namespace DataStorm | |
* | ||
* @return True if data writers are connected, false otherwise. | ||
*/ | ||
bool hasWriters() const noexcept; | ||
[[nodiscard]] bool hasWriters() const noexcept; | ||
|
||
/** | ||
* Wait for given number of data writers to be online. | ||
|
@@ -580,7 +580,7 @@ namespace DataStorm | |
* | ||
* @return True if data readers are connected, false otherwise. | ||
*/ | ||
bool hasReaders() const noexcept; | ||
[[nodiscard]] bool hasReaders() const noexcept; | ||
|
||
/** | ||
* Wait for given number of data readers to be online. | ||
|
@@ -818,7 +818,7 @@ namespace DataStorm | |
* @param config The optional reader configuration. | ||
*/ | ||
template<typename K, typename V, typename UT> | ||
SingleKeyReader<K, V, UT> makeSingleKeyReader( | ||
[[nodiscard]] SingleKeyReader<K, V, UT> makeSingleKeyReader( | ||
const Topic<K, V, UT>& topic, | ||
const typename Topic<K, V, UT>::KeyType& key, | ||
std::string name = std::string(), | ||
|
@@ -838,7 +838,7 @@ namespace DataStorm | |
* @param config The optional reader configuration. | ||
*/ | ||
template<typename SFC, typename K, typename V, typename UT> | ||
SingleKeyReader<K, V, UT> makeSingleKeyReader( | ||
[[nodiscard]] SingleKeyReader<K, V, UT> makeSingleKeyReader( | ||
const Topic<K, V, UT>& topic, | ||
const typename Topic<K, V, UT>::KeyType& key, | ||
const Filter<SFC>& sampleFilter, | ||
|
@@ -860,7 +860,7 @@ namespace DataStorm | |
* @param config The optional reader configuration. | ||
*/ | ||
template<typename K, typename V, typename UT> | ||
MultiKeyReader<K, V, UT> makeMultiKeyReader( | ||
[[nodiscard]] MultiKeyReader<K, V, UT> makeMultiKeyReader( | ||
const Topic<K, V, UT>& topic, | ||
const std::vector<typename Topic<K, V, UT>::KeyType>& keys, | ||
std::string name = std::string(), | ||
|
@@ -882,7 +882,7 @@ namespace DataStorm | |
* @param config The optional reader configuration. | ||
*/ | ||
template<typename SFC, typename K, typename V, typename UT> | ||
MultiKeyReader<K, V, UT> makeMultiKeyReader( | ||
[[nodiscard]] MultiKeyReader<K, V, UT> makeMultiKeyReader( | ||
const Topic<K, V, UT>& topic, | ||
const std::vector<typename Topic<K, V, UT>::KeyType>& keys, | ||
const Filter<SFC>& sampleFilter, | ||
|
@@ -903,7 +903,7 @@ namespace DataStorm | |
* @param config The optional reader configuration. | ||
*/ | ||
template<typename K, typename V, typename UT> | ||
MultiKeyReader<K, V, UT> makeAnyKeyReader( | ||
[[nodiscard]] MultiKeyReader<K, V, UT> makeAnyKeyReader( | ||
const Topic<K, V, UT>& topic, | ||
std::string name = std::string(), | ||
const ReaderConfig& config = ReaderConfig()) | ||
|
@@ -923,7 +923,7 @@ namespace DataStorm | |
* @param config The optional reader configuration. | ||
*/ | ||
template<typename SFC, typename K, typename V, typename UT> | ||
MultiKeyReader<K, V, UT> makeAnyKeyReader( | ||
[[nodiscard]] MultiKeyReader<K, V, UT> makeAnyKeyReader( | ||
const Topic<K, V, UT>& topic, | ||
const Filter<SFC>& sampleFilter, | ||
std::string name = std::string(), | ||
|
@@ -1006,7 +1006,7 @@ namespace DataStorm | |
* @param config The optional reader configuration. | ||
*/ | ||
template<typename KFC, typename K, typename V, typename UT> | ||
FilteredKeyReader<K, V, UT> makeFilteredKeyReader( | ||
[[nodiscard]] FilteredKeyReader<K, V, UT> makeFilteredKeyReader( | ||
const Topic<K, V, UT>& topic, | ||
const Filter<KFC>& filter, | ||
std::string name = std::string(), | ||
|
@@ -1026,7 +1026,7 @@ namespace DataStorm | |
* @param config The optional reader configuration. | ||
*/ | ||
template<typename KFC, typename SFC, typename K, typename V, typename UT> | ||
FilteredKeyReader<K, V, UT> makeFilteredKeyReader( | ||
[[nodiscard]] FilteredKeyReader<K, V, UT> makeFilteredKeyReader( | ||
const Topic<K, V, UT>& topic, | ||
const Filter<KFC>& keyFilter, | ||
const Filter<SFC>& sampleFilter, | ||
|
@@ -1100,7 +1100,7 @@ namespace DataStorm | |
* @param tag The partial update tag. | ||
*/ | ||
template<typename UpdateValue> | ||
std::function<void(const UpdateValue&)> partialUpdate(const UpdateTag& tag) noexcept; | ||
[[nodiscard]] std::function<void(const UpdateValue&)> partialUpdate(const UpdateTag& tag) noexcept; | ||
|
||
/** | ||
* Remove the data element. This generates a {@link Remove} sample. | ||
|
@@ -1176,7 +1176,7 @@ namespace DataStorm | |
* @param tag The partial update tag. | ||
*/ | ||
template<typename UpdateValue> | ||
std::function<void(const Key&, const UpdateValue&)> partialUpdate(const UpdateTag& tag) noexcept; | ||
[[nodiscard]] std::function<void(const Key&, const UpdateValue&)> partialUpdate(const UpdateTag& tag) noexcept; | ||
|
||
/** | ||
* Remove the data element. This generates a {@link Remove} sample. | ||
|
@@ -1219,7 +1219,7 @@ namespace DataStorm | |
* @param config The optional writer configuration. | ||
*/ | ||
template<typename K, typename V, typename UT> | ||
MultiKeyWriter<K, V, UT> makeMultiKeyWriter( | ||
[[nodiscard]] MultiKeyWriter<K, V, UT> makeMultiKeyWriter( | ||
const Topic<K, V, UT>& topic, | ||
const std::vector<typename Topic<K, V, UT>::KeyType>& keys, | ||
std::string name = std::string(), | ||
|
@@ -1237,22 +1237,17 @@ namespace DataStorm | |
* @param config The optional writer configuration. | ||
*/ | ||
template<typename K, typename V, typename UT> | ||
MultiKeyWriter<K, V, UT> makeAnyKeyWriter( | ||
[[nodiscard]] MultiKeyWriter<K, V, UT> makeAnyKeyWriter( | ||
const Topic<K, V, UT>& topic, | ||
std::string name = std::string(), | ||
const WriterConfig& config = WriterConfig()) noexcept | ||
{ | ||
return MultiKeyWriter<K, V, UT>(topic, {}, std::move(name), config); | ||
} | ||
|
||
} | ||
|
||
// | ||
// Public template based API implementation | ||
// | ||
|
||
namespace DataStorm | ||
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. no point in declaring the same namespace twice. |
||
{ | ||
// | ||
// Public template based API implementation | ||
// | ||
|
||
// | ||
// Sample template implementation | ||
|
This file contains 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.
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.
Otherwise we get lints for issues that require using C++ 20 and we are still using C++ 17 with GCC.
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.
However, this breaks the linting of the Ice/span test. Maybe a better solution would be to disable the c++20 lints/suggestions?
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.
Maybe we could a
.clang-tidy
file to this test folder with an override to enable-std=c++20
. I think clang-tidy supports this.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.
I added a separate config for Ice/span test