-
Notifications
You must be signed in to change notification settings - Fork 20
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
Extend Widget time schema with support for new fixed_span and live_span object #1951
Extend Widget time schema with support for new fixed_span and live_span object #1951
Conversation
1e01ed8
to
3b35246
Compare
6347c88
to
5aa5790
Compare
2a3bcb7
to
48f8eb9
Compare
# check to see if the attribute exists and convert string to symbol for hash key | ||
attributes = attributes.each_with_object({}) { |(k, v), h| | ||
if (!self.class.attribute_map.key?(k.to_sym)) | ||
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::WidgetLegacyLiveSpan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect |
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.
⚪ Code Quality Violation
Consider using string interpolation or formatting instead of concatenation. (...read more)
The rule "Avoid string concatenation" is an important coding practice in Ruby for ensuring efficient and clean code. String concatenation in Ruby using the '+' operator creates a new string object, which can lead to excessive memory usage and slower performance when dealing with large strings or performing the operation multiple times.
Instead, Ruby provides alternatives that are more efficient. The string interpolation syntax #{}
allows you to insert variables directly into strings without creating new string objects. This is not only more memory efficient, but also provides cleaner and more readable code.
Another alternative is the format
method, which allows you to create a formatted string with placeholders for variables. This method is particularly useful when dealing with more complex strings, as it provides a clear and concise way to format your strings.
By following this rule, you can write more efficient and cleaner Ruby code, leading to better performance and readability.
indexes: [ | ||
"*", | ||
], |
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.
⚪ Code Quality Violation
Consider using the %W syntax instead (...read more)
The rule "Prefer %w
to the literal array syntax" is a Ruby style guideline that encourages the use of %w
notation instead of the traditional array syntax when defining arrays of strings. This rule is part of the Ruby community's efforts to promote readability and simplicity in Ruby code.
This rule is important because it helps to keep the code concise and easy to read. The %w
notation allows you to define an array of strings without having to use quotes and commas. This can make the code cleaner and easier to understand, especially when dealing with large arrays.
To follow this rule, replace the traditional array syntax with the %w
notation. For example, instead of writing ['foo', 'bar', 'baz']
, you should write %w[foo bar baz]
. This will create the same array, but in a more readable and concise way. By following this rule, you can help to make your Ruby code cleaner and easier to understand.
indexes: [ | ||
"*", | ||
], |
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.
⚪ Code Quality Violation
Consider using the %W syntax instead (...read more)
The rule "Prefer %w
to the literal array syntax" is a Ruby style guideline that encourages the use of %w
notation instead of the traditional array syntax when defining arrays of strings. This rule is part of the Ruby community's efforts to promote readability and simplicity in Ruby code.
This rule is important because it helps to keep the code concise and easy to read. The %w
notation allows you to define an array of strings without having to use quotes and commas. This can make the code cleaner and easier to understand, especially when dealing with large arrays.
To follow this rule, replace the traditional array syntax with the %w
notation. For example, instead of writing ['foo', 'bar', 'baz']
, you should write %w[foo bar baz]
. This will create the same array, but in a more readable and concise way. By following this rule, you can help to make your Ruby code cleaner and easier to understand.
indexes: [ | ||
"*", | ||
], |
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.
⚪ Code Quality Violation
Consider using the %W syntax instead (...read more)
The rule "Prefer %w
to the literal array syntax" is a Ruby style guideline that encourages the use of %w
notation instead of the traditional array syntax when defining arrays of strings. This rule is part of the Ruby community's efforts to promote readability and simplicity in Ruby code.
This rule is important because it helps to keep the code concise and easy to read. The %w
notation allows you to define an array of strings without having to use quotes and commas. This can make the code cleaner and easier to understand, especially when dealing with large arrays.
To follow this rule, replace the traditional array syntax with the %w
notation. For example, instead of writing ['foo', 'bar', 'baz']
, you should write %w[foo bar baz]
. This will create the same array, but in a more readable and concise way. By following this rule, you can help to make your Ruby code cleaner and easier to understand.
2c531d5
to
a775a02
Compare
a775a02
to
ac5c483
Compare
…an object (#1951) Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <[email protected]> 3190bdd
See DataDog/datadog-api-spec#2745
Test branch datadog-api-spec/test/bruce.tu/DBNBK-116-Extend-Widget.TIME-schema