| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
---------
Co-authored-by: SarahVanHaute <[email protected]>
Co-authored-by: Geremia Taglialatela <[email protected]>
|
|
- Lint/AmbiguousOperatorPrecedence
- Style/PerlBackrefs
- Style/StringChars
- Style/UnpackFirst
|
|
Caxlsx is using both `.` and `::`, 220 occurrences vs 280 to invoke
methods on `Axlsx` module.
This commit standardizes the approach towards `.`, which will also allow
shorter lines.
Performance is not affected
```
Comparison:
Axlsx.validate: 8515252.3 i/s
Axlsx::validate: 8512863.7 i/s - same-ish: difference falls within error
```
|
|
This commit fixes cases that cannot be detected by RuboCop
Ref: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FormatString
|
|
`%` is an operation on `String` that will return a new `String`, so
the interpolation is redundant
Also adds a missing spec on PivotTable#rels_pn
```
IPS:
uninterpolated: 4045715.7 i/s
interpolated: 2359775.6 i/s - 1.71x (± 0.00) slower
Memory:
uninterpolated: 160 allocated
interpolated: 232 allocated - 1.45x more
```
|
|
`Kernel#format` is faster and will avoid to allocate an array compared
to `String#%`.
```
IPS:
kernel_format: 3877614.2 i/s
string_percent: 3531475.0 i/s - 1.10x (± 0.00) slower
Memory:
kernel_format: 160 allocated
string_percent: 200 allocated - 1.25x more
```
|
|
tagliala/chore/fix-string-concatenation-in-non-production-code
Fix StringConcatenation offenses (non-production)
|
|
Use #== and #eql? from BasicObject
|
|
Prefer interpolation over concatenation
```
Comparison ("String#{'String'}" vs 'String' + 'String'):
interpolation: 11821321.0 i/s
concatenation: 8849491.7 i/s - 1.34x (± 0.00) slower
```
|
|
Fix profiler deprecations
|
|
Enable Security cops
|
|
This is an extreme case, but it really shows the impact of merging cells.
|
|
```
NOTE: RubyProf.profile is deprecated; use Profile.profile instead. It will be removed on or after 2023-06.
RubyProf.profile called from ./test/profile.rb:14.
NOTE: RubyProf.running? is deprecated; use Profile#running? instead. It will be removed on or after 2023-06.
NOTE: RubyProf.measure_mode is deprecated; use Profile#measure_mode instead. It will be removed on or after 2023-06.
NOTE: RubyProf.exclude_threads is deprecated; use Profile#exclude_threads instead. It will be removed on or after 2023-06.
```
|
|
Also fixes a Security/Open offense that couldn't be exploited, because
the only invocation of `get_mime_type_from_uri` was validating the
input with a `URI::DEFAULT_PARSER` regexp
|
|
|
|
|
|
|
|
The `u=` would convert `true` to `:single` for backwards compatibility.
However, it is more explicit to set it to `:single` or one of the other
underline options instead of relying on the conversion.
|
|
|
|
In cases with lots of rows, each column will ask for its col_ref which will
always be the same for the same column_index. We can cache this to avoid
lots of small string allocations.
Modified `CellSerializer` to use `#col_ref` and `#row_ref` avoiding the string
allocation caused by `#col_r`
|
|
internal list instance
The `to_a` and `to_ary` now work more like standard Array methods with `to_a` returning a
new array containing the elements of self and `to_ary` returning self.
|
|
Currently the SimpleTypedList is wrapping `@list` Array and re-implementing
certain methods to add type / value checking and delegating all the
non-destrutive methods to the internal @list.
Most everything that ends up being serialized to the excel file is derived
from SimpleTypedList (for example, a Row is a SimpleTypedList of Cells). This
means that many of the delegated methods are hit over and over again especially
`[]`. This extra delegation really adds up.
We can avoid the delegation by having SimpleTypedList extend Array and still
remove any un-safe methods.
It is possible to re-introduce an unsafe method in a subclass of SimpleTypedList
if needed. Here is one way,
```ruby
class MyList < SimpleTypedList
def clear
@clear_method ||= Array.instance_method(:clear).bind(self)
@clear_method.call
end
end
```
|
|
Added zip_command variant to benchmark.rb and added profile_memory.rb based on
the `memory_profiler` gem.
|
|
|
|
|
|
|
|
Also fixes performance offences in non-production code
|
|
|
|
|
|
|
|
|
|
|
|
Remove some old code related to Ruby 1.x
|
|
|
|
- Style/MethodCallWithoutArgsParentheses
- Style/StringLiteralsInInterpolation
|
|
|
|
- Lint/AmbiguousBlockAssociation
- Lint/AmbiguousOperatorPrecedence
- Lint/EmptyBlock
- Lint/RedundantSplatExpansion
- Lint/RedundantStringCoercion
- Lint/SymbolConversion
- Lint/UnusedBlockArgument
- Style/BlockDelimiters
- Style/CommentAnnotation
- Style/EachForSimpleLoop
- Style/EmptyMethod
- Style/ExpandPathArguments
- Style/FileWrite
- Style/GlobalStdStream (UNSAFE)
- Style/HashEachMethods (UNSAFE)
- Style/NestedParenthesizedCalls
- Style/NilComparison
- Style/NumericLiteralPrefix (manually fixed)
- Style/ParallelAssignment
- Style/PreferredHashMethods (UNSAFE)
- Style/RedundantInterpolation (UNSAFE)
- Style/RedundantParentheses (UNSAFE)
- Style/RegexpLiteral
- Style/RescueStandardError
- Style/SpecialGlobalVars (UNSAFE)
- Style/SymbolProc (UNSAFE)
- Style/ZeroLengthPredicate (UNSAFE)
|
|
|
|
|
|
escape_formulas - add settings for global, workbook, worksheet, row and cell levels
|
|
|
|
|
|
add test cases
|
|
|
|
Some offenses have been selected and fixed automatically
|