Skip to content
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

Unable to format with Rubocop #3

Open
anlek opened this issue Jul 28, 2021 · 1 comment
Open

Unable to format with Rubocop #3

anlek opened this issue Jul 28, 2021 · 1 comment

Comments

@anlek
Copy link

anlek commented Jul 28, 2021

When I use the keyboard shortcut, I get the following error in my console:

Unable to open /Users/andrew/Library/Application Support/Sublime Text 3/Packages/Codefmt/Codefmt.sublime-settings
git: tracking working dir /Users/andrew/Library/Application Support/Sublime Text 3/Packages/User
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1518, in run_
    return self.run(edit)
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Codefmt.sublime-package/FormatCodeFile.py", line 7, in run
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Codefmt.sublime-package/utils.py", line 37, in format_code_file
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Codefmt.sublime-package/utils.py", line 122, in find_matching_formatters
TypeError: 'NoneType' object is not iterable

My config looks like this:

{
  "format_on_save": true,
  "debug": true,
  "rubocop": {
    // The command that will be executed for format files.
    "command": [
      "/Users/andrew/.asdf/shims/rubocop",
      "--auto-correct-all",
      "--config",
      "$config",
      "$file"
    ],

    // The scopes that will be considered when formatting
    "scopes": ["source.ruby", "source.ruby.rails"],

    // Additional flags when running in debug mode.
    "debug": ["--debug", "--extra-details"],

    // When no custom config file exists, use a default config file.
    "default_config": null,

    // Config files that will be looked up on the root of the project.
    "config_files": [".rubocop.yml"]
  },
  "formatters": [
    "rubocop",
  ]
}

However, I've tried running the code with my settings looking like: {}

I believe this issue is actually that it can't find the /Users/andrew/Library/Application Support/Sublime Text 3/Packages/Codefmt/Codefmt.sublime-settings. As the Codefmt is not there for me.

@anlek
Copy link
Author

anlek commented Jul 29, 2021

I manually created the Codefmt folder and that part of the error goes away,
However, I still get:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1518, in run_
    return self.run(edit)
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Codefmt.sublime-package/FormatCodeFile.py", line 7, in run
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Codefmt.sublime-package/utils.py", line 37, in format_code_file
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Codefmt.sublime-package/utils.py", line 122, in find_matching_formatters
TypeError: 'NoneType' object is not iterable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant