summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet
AgeCommit message (Collapse)Author
2023-06-15Fix redundant self offensesGeremia Taglialatela
No performance gain, this can be seen as a cosmetic change to have shorter lines
2023-06-13Fix safe Style/Lambda offensesGeremia Taglialatela
- Use literal syntax on single line - Use lambda method on multiple lines Ref: https://rubystyle.guide/#lambda-multi-line
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-05Merge pull request #274 from tagliala/chore/fix-negated-if-offensesZsolt Kozaroczy
Fix negated if offenses
2023-06-02Fix negated if offensesGeremia Taglialatela
Should also provide a negligible performance improvement, about 3% on Ruby 3.2 and 6% on Ruby 2.6 (M1 Pro)
2023-05-31Remove redundant parenthesesGeremia Taglialatela
- Style/ParenthesesAroundCondition - Style/RedundantParentheses - Style/TernaryParentheses `Style/ParenthesesAroundCondition` may be questionable, but a majority of comparison where not using parentheses, so offenses have been fixed for uniformity across the codebase
2023-05-31Use Ruby 1.9 hash syntaxGeremia Taglialatela
2023-05-31Merge pull request #268 from tagliala/chore/fix-symbol-proc-offensesZsolt Kozaroczy
Fix Style/SymbolProc offenses
2023-05-31Merge pull request #267 from tagliala/chore/freeze-mutable-constantsZsolt Kozaroczy
Fix Style/MutableConstant offenses
2023-05-31Fix Style/SymbolProc offensesGeremia Taglialatela
This also provides a performance improvement ``` Comparison (array of 4 elements): map(&): 3643131.4 i/s map {}: 3488052.5 i/s - 1.04x (± 0.00) slower Comparison (array of 20 elements): map(&): 466013.9 i/s map {}: 408447.2 i/s - 1.14x (± 0.00) slower ```
2023-05-31Fix Style/MutableConstant offensesGeremia Taglialatela
2023-05-31Fix Style/ConditionalAssignment offensesGeremia Taglialatela
2023-05-31Fix string concatenation offenses in production codeGeremia Taglialatela
2023-05-31Merge pull request #262 from tagliala/chore/fix-if-inside-else-offenseZsolt Kozaroczy
Fix Style/IfInsideElse offense
2023-05-24Fix Style/IfInsideElse offenseGeremia Taglialatela
2023-05-24Fix Style/RedundantFileExtensionInRequire offensesGeremia Taglialatela
2023-05-22Merge pull request #242 from tagliala/chore/fix-minor-safe-offensesZsolt Kozaroczy
Remove minor safe offenses
2023-05-21Improve commentsGeremia Taglialatela
- Use https where possible - Capitalize Excel
2023-05-20Remove minor safe offensesGeremia Taglialatela
- Style/RaiseArgs - Style/RedundantCondition - Style/RedundantReturn - Style/SelfAssignment - Style/SoleNestedConditional
2023-05-17Fix safe performance RuboCop offenses Geremia Taglialatela
- Fix Performance/RedundantMatch and Performance/RegexpMatch - Fix Performance/RedundantSplitRegexpArgument
2023-05-15Serialize attributes more efficientlyPaul Kmiec
The attributes in rows, cells, styles, etc are pre-defined for each type and almost never change. The current code, however, does not take that into account by reading all instance variables (via declared_attributes), filtering out the blank one and ones that are not xml attributes, and by camelizing each one. We can avoid all this extra work by computing the camels and ivars for xml attributes once and directly read the instance variables we care about.
2023-05-10Fix Inefficient Hash Search offensesGeremia Taglialatela
Use `key?` instead of `keys.include?` to improve performance
2023-05-05Pipe output directly to str and avoid additional memory allocationsPaul Kmiec
Currently, there are lots of examples of code like this, ``` str << ('<tag ' << foo << ' ' << bar << '/>') ``` which create the string for the tag in memory before piping to str. We can avoid creating all of these intermediate strings by dropping the paranthesis and piping directly to str. This relies on the `str` passed around to handle lots of small appends. This is a problem when using RubyZip, but that is solved in the next commit.
2023-05-04Fix tests / code to work with frozen string literalsPaul Kmiec
2023-05-04Enable Style/FrozenStringLiteralComment and autocorrectPaul Kmiec
2023-05-03Fix safe, minor offenses to production codeGeremia Taglialatela
- Lint/RedundantStringCoercion - Style/CommentAnnotation offenses - Style/DefWithParentheses - Style/EvalWithLocation - Style/MethodCallWithoutArgsParentheses - Style/MethodDefParentheses - Style/NilComparison - Style/Semicolon
2023-04-10Fix Layout/LeadingCommentSpace offensesGeremia Taglialatela
``` rubocop --only Layout/LeadingCommentSpace -a ```
2023-04-09Fix Layout/ExtraSpacing offensesGeremia Taglialatela
Configure with `AllowBeforeTrailingComments: true`
2023-04-09Fix offenses related to indentation consistencyGeremia Taglialatela
2023-04-08Fix Layout/EmptyLineAfterGuardClause offensesGeremia Taglialatela
``` rubocop --only Layout/EmptyLineAfterGuardClause -a ```
2023-04-08Fix space-related offensesGeremia Taglialatela
- Layout/SpaceAfterComma - Layout/SpaceAroundEqualsInParameterDefault - Layout/SpaceAroundOperators - Layout/SpaceBeforeBlockBraces - Layout/SpaceInsideBlockBraces - Layout/SpaceInsideHashLiteralBraces - Layout/SpaceInsideParens
2023-04-08Fix EmptyLines related offensesGeremia Taglialatela
2023-04-08Fix Layout/SpaceBeforeFirstArg offensesGeremia Taglialatela
``` rubocop --only Layout/SpaceBeforeFirstArg -a ```
2023-04-08Fix an indentation issue manuallyGeremia Taglialatela
Also regenerate config
2023-04-06Fix Layout offenses related to access modifiersGeremia Taglialatela
``` rubocop --only Layout/EmptyLinesAroundAccessModifier,Layout/AccessModifierIndentation -a ```
2023-04-06Fix Layout/CommentIndentation offensesGeremia Taglialatela
``` rubocop --only Layout/CommentIndentation -a ```
2023-04-06Fix Layout/EmptyLineBetweenDefs offensesGeremia Taglialatela
``` rubocop --only Layout/EmptyLineBetweenDefs -a ```
2023-04-06Fix Layout/EmptyLines offensesGeremia Taglialatela
``` rubocop --only Layout/EmptyLines -a ```
2023-04-06Fix Style/Encoding offensesGeremia Taglialatela
``` rubocop --only Style/Encoding -a ```
2023-04-06Remove Layout/TrailingWhitespace offensesGeremia Taglialatela
``` rubocop --only Layout/TrailingWhitespace -a ```
2022-11-02Improve BorderCreator argsWeston Ganger
2022-10-12Resolve all TODOsWeston Ganger
2022-10-09Cleanup Stylesheet#add_stylesWeston Ganger
2022-09-29Merge axlsx_styler gem into caxlsxWeston Ganger
2022-09-26Make sure all examples and docs use binary mode for reading / writing XLSX filesStefan
Not using binary mode can cause encoding issues, see #138.
2022-03-02instance_values -> instance_values_forpjskennedy
2022-03-02Update references to use new class methodpjskennedy
2022-02-06Allow border style to accept an Array (#117)Weston Ganger
Co-authored-by: Noel Peden <[email protected]>
2019-10-29fix validate document with font option underlineAli Mujtaba