summaryrefslogtreecommitdiffhomepage
path: root/test
AgeCommit message (Collapse)Author
2023-10-19Fix frozen string error for scatter series with non-default markerKoza
2023-10-19Fix data validations for none type validations to show warnings onlyKoza
2023-10-19Add optional interpolation points to icon setsKoza
2023-10-02Fix failing specjohnnyshields
2023-10-02Set escape_formulas as "true" as a global default.johnnyshields
2023-08-15Added sorting to the AutoFilter class - add sort conditions to the xml (#286)rikweelvoormedia
--------- Co-authored-by: SarahVanHaute <[email protected]> Co-authored-by: Geremia Taglialatela <[email protected]>
2023-07-05Fix offenses in sheet protectionGeremia Taglialatela
- Lint/AmbiguousOperatorPrecedence - Style/PerlBackrefs - Style/StringChars - Style/UnpackFirst
2023-06-10Fix safe Style/ColonMethodCall offensesGeremia Taglialatela
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 ```
2023-06-05Prefer `Kernel#format` to `String#%`Geremia Taglialatela
This commit fixes cases that cannot be detected by RuboCop Ref: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FormatString
2023-06-05Fix Style/RedundantInterpolation offensesGeremia Taglialatela
`%` 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 ```
2023-06-05Fix Style/FormatString offensesGeremia Taglialatela
`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 ```
2023-05-31Merge pull request #261 from ↵Zsolt Kozaroczy
tagliala/chore/fix-string-concatenation-in-non-production-code Fix StringConcatenation offenses (non-production)
2023-05-31Merge pull request #255 from pkmiec/fixSimpleTypeListRegressionZsolt Kozaroczy
Use #== and #eql? from BasicObject
2023-05-25Fix StringConcatenation offenses (non-production)Geremia Taglialatela
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 ```
2023-05-24Merge pull request #256 from tagliala/chore/fix-profiler-deprecationsZsolt Kozaroczy
Fix profiler deprecations
2023-05-24Merge pull request #252 from tagliala/security/enable-security-copsZsolt Kozaroczy
Enable Security cops
2023-05-23Add benchmark with merge cellsPaul Kmiec
This is an extreme case, but it really shows the impact of merging cells.
2023-05-23Fix profiler deprecationsGeremia Taglialatela
``` 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. ```
2023-05-23Enable Security copsGeremia Taglialatela
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
2023-05-22Use Ruby 1.9 hash syntax (non-production code)Geremia Taglialatela
2023-05-20Fix sheet_by_name for sheets with escaped charactersAdam Kiczula
2023-05-17Merge branch 'master' into cacheColRefZsolt Kozaroczy
2023-05-15Remove ability to set `u=` to true in favor of :singlePaul Kmiec
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.
2023-05-15Corrected rubocop offenses in lib/axlsx.rb / test/tc_axlsx.rbPaul Kmiec
2023-05-15Cache col_ref to avoid allocationsPaul Kmiec
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`
2023-05-10Fix `SimpleTypedList#to_a` and `SimpleTypedList#to_ary` returning the ↵Paul Kmiec
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.
2023-05-10Derive SimpleTypedList from ArrayPaul Kmiec
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 ```
2023-05-05Improve benchmarking / profilingPaul Kmiec
Added zip_command variant to benchmark.rb and added profile_memory.rb based on the `memory_profiler` gem.
2023-05-04Fix tests / code to work with frozen string literalsPaul Kmiec
2023-05-04Enable Style/FrozenStringLiteralComment and autocorrectPaul Kmiec
2023-05-03Fix unescaped dot in regexp and convert to includeGeremia Taglialatela
2023-05-03Introduce RuboCop performanceGeremia Taglialatela
Also fixes performance offences in non-production code
2023-05-03Fix Style/MapToHash offense (unsafe)Geremia Taglialatela
2023-05-03Fix non-production Style/NumericLiterals offensesGeremia Taglialatela
2023-05-03Remove redundant load pathsGeremia Taglialatela
2023-05-03Fix Style/RedundantFileExtensionInRequire offenseGeremia Taglialatela
2023-05-03Fix tests not using valuesGeremia Taglialatela
2023-05-03Fix time testsGeremia Taglialatela
Remove some old code related to Ruby 1.x
2023-05-03Fix boolean testGeremia Taglialatela
2023-05-03Fix other non-production offensesGeremia Taglialatela
- Style/MethodCallWithoutArgsParentheses - Style/StringLiteralsInInterpolation
2023-05-03Add RuboCop MinitestGeremia Taglialatela
2023-05-03Fix offenses to non-production codeGeremia Taglialatela
- 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)
2023-04-23Add test to ensure various OWASP prefixes are never parsed as formulaStefan
2023-04-12Mock out external image requests to make the CI more stableKoza
2023-04-12Merge pull request #186 from tablecheck/escape-formulas-improvementZsolt Kozaroczy
escape_formulas - add settings for global, workbook, worksheet, row and cell levels
2023-04-12Rubocop fixesKoza
2023-04-12improve testsSebastiano
2023-04-12improve validationSebastiano
add test cases
2023-04-13Merge branch 'master' into escape-formulas-improvementJohnny Shields
2023-04-10Fix some Layout/HashAlignment offensesGeremia Taglialatela
Some offenses have been selected and fixed automatically