profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/bbatsov/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Bozhidar Batsov bbatsov Toptal (@toptal) Bulgaria https://metaredux.com Hacker. Emacs fanatic. Author of RuboCop, CIDER, Projectile and others. I'm not the best, but I'm pretty good. ;-)

bbatsov/clojure-style-guide 3649

A community coding style guide for the Clojure programming language

bbatsov/crux 581

A Collection of Ridiculously Useful eXtensions for Emacs

bbatsov/beamer-torino-theme 36

Torino, a pretty theme for LaTex Beamer

bbatsov/cl-99-problems 10

Solutions to the 99 Lisp problems in Common Lisp

bbatsov/cv 10

My professional CV in LaTeX

bbatsov/activerecord-extra-validators 9

Some nice additional validators for ActiveRecord

bbatsov/bbatsov.github.com 8

My personal blog

bbatsov/avy 3

Jump to things in Emacs tree-style

bbatsov/cljfmt 3

A tool for formatting Clojure code

bbatsov/blog 2

My personal blog

pull request commentrubocop/ruby-style-guide

feat: flip-flop statements no longer deprecated

A PR is welcome.

thestelz

comment created time in 11 minutes

pull request commentrubocop/ruby-style-guide

feat: flip-flop statements no longer deprecated

Another source, if needed: https://blog.saeloun.com/2020/01/06/ruby-2-7-revert-flip-flop-operator-deprecation.html

thestelz

comment created time in an hour

PR opened rubocop/ruby-style-guide

feat: flip-flop statements no longer deprecated

Flip-Flop statements are no longer deprecated per ruby bugs 5400. Remove deprecated note.

See: https://bugs.ruby-lang.org/issues/5400

+0 -2

0 comment

1 changed file

pr created time in an hour

startedbbatsov/crux

started time in 3 hours

issue commentbbatsov/projectile

Unable to completing-read CMake preset the second time

Thanks @jehelset , I will try your code. I really like the concept of separate "reconfigure" command.

laurynas-biveinis

comment created time in 3 hours

startedbbatsov/projectile

started time in 3 hours

startedbbatsov/prelude

started time in 7 hours

startedbbatsov/persp-projectile

started time in 18 hours

issue commentbbatsov/projectile

Unable to completing-read CMake preset the second time

as a quickfix you could use something like this:


(defun projectile-reconfigure-command (compile-dir)
  "Retrieve the configure command for COMPILE-DIR without considering history.

The command is determined like this:

- first we check for `projectile-project-configure-cmd' supplied
via .dir-locals.el

- finally we check for the default configure command for a
project of that type"
  (or projectile-project-configure-cmd
      (let ((cmd-format-string (projectile-default-configure-command (projectile-project-type))))
        (when cmd-format-string
          (format cmd-format-string (projectile-project-root) compile-dir)))))

(defun projectile-reconfigure-project (arg)
  "Run project configure command without considering command history.

Normally you'll be prompted for a compilation command, unless
variable `compilation-read-command'.  You can force the prompt
with a prefix ARG."
  (interactive "P")
  (let ((command (projectile-reconfigure-command (projectile-compilation-dir))))
    (projectile--run-project-cmd command projectile-configure-cmd-map
                                 :show-prompt arg
                                 :prompt-prefix "Configure command: "
                                 :save-buffers t)))

and bind projectile-reconfigure-command to a suitable key.

laurynas-biveinis

comment created time in 18 hours

fork muduta/prelude

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.

https://prelude.emacsredux.com

fork in 19 hours

issue commentbbatsov/projectile

Unable to completing-read CMake preset the second time

i think this is simply how the project-type-agnosticprojectile-configure-command works (https://github.com/bbatsov/projectile/blob/master/projectile.el#L4337). it will prefer to use the cached command. to get the behaviour you want, one would have to be able to disable caching of configuration commands. not sure if this is possible currently.

laurynas-biveinis

comment created time in 19 hours

fork lboogaard/prelude

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.

https://prelude.emacsredux.com

fork in 20 hours

startedbbatsov/prelude

started time in 21 hours

issue commentrubocop/rubocop

Old specs need love

There are still 4 uses of autocorrect_source and 1 of inspect_source in the specs that would ideally be removed

marcandre

comment created time in 21 hours

issue commentrubocop/rubocop

Old specs need love

Or am I missing something?

I mean if there are no issues could we close the issue?

marcandre

comment created time in a day

PR opened rubocop/rubocop

Fix an incorrect auto-correct for `Layout/LineLength`

This PR fixes an incorrect auto-correct for Layout/LineLength when using heredoc as the first method argument and omitting parentheses.

% cat example.rb
foo <<~RUBY, arg
RUBY

% bundle exec rubocop --only Layout/LineLength -a
(snip)

Inspecting 1 file
C

Offenses:

example.rb:1:16: C: [Corrected] Layout/LineLength: Line is too long. [16/15]
foo <<~RUBY, arg
               ^

1 file inspected, 1 offense detected, 1 offense corrected

% cat example.rb
foo <<~RUBY,
arg
RUBY

% ruby -c example.rb
example.rb:1: syntax error, unexpected end-of-input

Before submitting the PR make sure the following are checked:

  • [x] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • [x] Wrote good commit messages.
  • [ ] Commit message starts with [Fix #issue-number] (if the related issue exists).
  • [x] Feature branch is up-to-date with master (if not - rebase it).
  • [x] Squashed related commits together.
  • [x] Added tests.
  • [x] Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • [x] Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
+22 -1

0 comment

3 changed files

pr created time in a day

issue commentrubocop/rubocop

Old specs need love

spec/support/multiline_literal_brace_layout_trailing_comma_examples.rb

I don't see an issue. If the failure message is different, ^{foo} [...] should match any failure with indent with the length of foo.

spec/support/alignment_examples.rb

I don't see an issue, the two cases should be combined and expect_correction used instead of autocorrect_source.

Or am I missing something?

marcandre

comment created time in a day

issue commentrubocop/rubocop

CommentConfig needs ♥️

@dvandersluis Could we close the issue?

AndreiEres

comment created time in a day

issue commentrubocop/rubocop

Request: Style/RedundantBegin should ignore usage for memoization

@koic you are right, thanks

johnnyshields

comment created time in a day

issue commentrubocop/rubocop

Old specs need love

Could you tell me, please? What can we do with old syntax in that files? spec/support/alignment_examples.rb spec/support/multiline_literal_brace_layout_trailing_comma_examples.rb

@marcandre

marcandre

comment created time in a day

PR opened rubocop/rubocop

Fix a false positive for `Style/RegexpLiteral`

This PR fixes the following false positive for Style/RegexpLiteral when using a regexp starts with a blank as a method argument.

% cat example.rb
do_something %r| regexp|

% bundle exec rubocop --only Style/RegexpLiteral -a
(snip)

Offenses:

example.rb:1:14: C: [Corrected] Style/RegexpLiteral: Use // around regular expression.
do_something %r| regexp|
             ^^^^^^^^^^^

1 file inspected, 1 offense detected, 1 offense corrected

% cat example.rb
do_something / regexp/

% ruby -c example.rb
example.rb:1: syntax error, unexpected end-of-input

Before submitting the PR make sure the following are checked:

  • [x] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • [x] Wrote good commit messages.
  • [ ] Commit message starts with [Fix #issue-number] (if the related issue exists).
  • [x] Feature branch is up-to-date with master (if not - rebase it).
  • [x] Squashed related commits together.
  • [x] Added tests.
  • [x] Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • [x] Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
+42 -2

0 comment

3 changed files

pr created time in 2 days

issue openedrubocop/rubocop

Behaviour of home directory .rubocop.yml vs project specific .rubocop.yml

Hey. I'm having a problem using a .rubocop.yml in my home directory.

I'm using rbenv, rbenv-gemsets and bundler to isolate the project, and in a project dir we have a project specific .rubocop.yml, specifying a TargetRubyVersion of 2.6, compatible with the older version of rubocop.

In my home directory I have a .rubocop.yml intended for use w/ a newer version of rubocop and ruby than what we're running in the project. It has a TargetRubyVersion of 3.0.

When invoking rubocop -d in the project dir, here is the output.

<details> <summary>output when invoking rubocop -d in the project dir</summary>

For /home/odin/dev/project/repo: configuration from /home/odin/dev/project/repo/.rubocop.yml
configuration from /home/odin/.rbenv/versions/2.6.6/gemsets/project/gems/rubocop-rspec-1.32.0/config/default.yml
configuration from /home/odin/.rbenv/versions/2.6.6/gemsets/project/gems/rubocop-rspec-1.32.0/config/default.yml
Default configuration from /home/odin/.rbenv/versions/2.6.6/gemsets/project/gems/rubocop-0.70.0/config/default.yml
configuration from /home/odin/.rbenv/versions/2.6.6/gemsets/project/gems/rubocop-performance-1.3.0/config/default.yml
configuration from /home/odin/.rbenv/versions/2.6.6/gemsets/project/gems/rubocop-performance-1.3.0/config/default.yml
Inheriting configuration from /home/odin/dev/work/fakturabank/repo/.rubocop_todo.yml
.rubocop.yml: Layout/MultilineMethodCallIndentation:Enabled overrides the same parameter in .rubocop_todo.yml
AllCops/Exclude configuration from /home/odin/.rubocop.yml
Warning: unrecognized cop Gemspec/DateAssignment found in /home/odin/.rubocop.yml
Warning: unrecognized cop Layout/SpaceBeforeBrackets found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/AmbiguousAssignment found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/DeprecatedConstants found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/DuplicateBranch found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/DuplicateRegexpCharacterClassElement found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/EmptyBlock found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/EmptyClass found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/EmptyInPattern found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/LambdaWithoutLiteralBlock found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/NoReturnInBeginEndBlocks found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/NumberedParameterAssignment found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/OrAssignmentToConstant found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/RedundantDirGlobSort found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/SymbolConversion found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/ToEnumArguments found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/TripleQuotes found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/UnexpectedBlockArity found in /home/odin/.rubocop.yml
Warning: unrecognized cop Lint/UnmodifiedReduceAccumulator found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/ArgumentsForwarding found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/CollectionCompact found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/DocumentDynamicEvalDefinition found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/EndlessMethod found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/HashConversion found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/HashExcept found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/IfWithBooleanLiteralBranches found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/InPatternThen found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/MultilineInPatternThen found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/NegatedIfElseCondition found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/NilLambda found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/QuotedSymbols found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/RedundantArgument found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/StringChars found in /home/odin/.rubocop.yml
Warning: unrecognized cop Style/SwapValues found in /home/odin/.rubocop.yml
Error: Unknown Ruby version 3.0 found in `TargetRubyVersion` parameter (in /home/odin/.rubocop.yml).
Supported versions: 2.3, 2.4, 2.5, 2.6                                                                                                        
Finished in 0.3350943620025646 seconds

</details>

Based on the documentation at https://docs.rubocop.org/rubocop/configuration.html I expected rubocop only to load configuration from my home directory if it could not find a .rubocop.yml inside the project directory.

As an example, if RuboCop is invoked from inside /path/to/project/lib/utils, then RuboCop will use the config as specified inside the first of the following files:

  • /path/to/project/lib/utils/.rubocop.yml
  • /path/to/project/lib/.rubocop.yml
  • /path/to/project/.rubocop.yml
  • /.rubocop.yml
  • ~/.rubocop.yml
  • ~/.config/rubocop/config.yml
  • RuboCop’s default configuration

Am I misunderstanding the docs or is this a bug?

Versions in project

0.70.0 (using Parser 2.6.3.0, running on ruby 2.6.6 x86_64-linux)

Versions in home dir (system)

1.16.1 (using Parser 3.0.1.1, rubocop-ast 1.7.0, running on ruby 3.0.1 x86_64-linux)

created time in 2 days

fork purcell/hdf4

Official HDF4 Library Repository

fork in 2 days

issue commentrubocop/rubocop

A cop that enforces `Gemfile` vs `gems.rb`

Is this still available? Looks like a good first issue for me to get my hands on 😄

ngan

comment created time in 2 days

issue closedrubocop/rubocop

False positive for Layout/ArgumentAlignment

The following code is in a .js.haml file in my Rails application and somehow, it's triggering an offense for the cop Layout/ArgumentAlignment:

https://github.com/openSUSE/open-build-service/blob/94660dfcced5541ece9ed3c964c779896ad051b6/src/api/app/views/webui/interconnects/create.js.haml#L5

I kept the exact same indentation as in my file. This is what RuboCop outputs:

Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.

After trying out various indentation changes, I just don't get it. Someone has a clue?

RuboCop version

1.16.1 (using Parser 3.0.1.1, rubocop-ast 1.7.0, running on ruby 2.5.8 x86_64-linux-gnu)
  - rubocop-performance 1.10.2
  - rubocop-rails 2.10.1
  - rubocop-rspec 2.2.0

RuboCop is called from haml-lint, this is why it's linting a .js.haml file.

closed time in 3 days

dmarcoux

issue commentrubocop/rubocop

False positive for Layout/ArgumentAlignment

Layout/ArgumentAlignment cop now supports first keyword arguments and HAML-Lint will need to support it. https://github.com/rubocop/rubocop/pull/9798

I'm not familiar with HAML-Lint, but at least it's passed to RuboCop with the following alignment, so this is not a false positive.

openSUSE/open-build-service code

$('.in-place-editing').html("#{escape_javascript(render(partial: 'webui/package/basic_info',
                                                        locals: { package: @package, project: @project }))}");

The result of some processing of haml-lint

render(partial: 'webui/package/basic_info',
                                                            locals: { package: @package, project: @project })

Can you open the issue to HAML-Lint? https://github.com/sds/haml-lint

Thank you.

dmarcoux

comment created time in 3 days

issue commentbbatsov/projectile

Projectile not remembering remote projects

It might be something related to the remote project name being the same as a local project name, hmm

jingxlim

comment created time in 3 days

startedbbatsov/projectile

started time in 3 days

startedbbatsov/projectile

started time in 3 days