Automatic stylistic changes due to linting errors are not ideal #4189

Open
opened 2026-02-16 17:42:58 -05:00 by yindo · 6 comments
Owner

Originally created by @tqian86 on GitHub (Jan 4, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Since a recent update (probably around 1.0.20x), using OpenCode to edit any Python file will result in stylistic changes likely due to linting error messages. For example, PEP8 recommends using double quotes for strings, so all single quote strings are converted to double quotes. An example:

 CACHE_TYPES = [
-    'simple',
-    'filesystem',
-    'redis',
-    'redissentinel',
-    'uwsgi',
-    'memcached',
-    'gaememcached',
-    'saslmemcached',
-    'spreadsaslmemcached',
+    "simple",
+    "filesystem",
+    "redis",
+    "redissentinel",
+    "uwsgi",
+    "memcached",
+    "gaememcached",
+    "saslmemcached",
+    "spreadsaslmemcached",
 ]

Also some frivious formatting changes like this:

-        """ A cached resource with short expiration """
+        """A cached resource with short expiration"""

or this:

-CACHE_BUSTING_METHODS = [
-    'POST',
-    'PUT',
-    'PATCH',
-    'DELETE'
-]
+CACHE_BUSTING_METHODS = ["POST", "PUT", "PATCH", "DELETE"]

Setting pyright to disabled in opencode.json has no effect on this behavior.

These changes are polluting the diff for existing projects. It is also difficult to prompt away this behavior. For example, grok code fast 1 doesn't seem to understand "make functional changes only. do not address formatting issues".

Plugins

No response

OpenCode version

1.1.1

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Debian 13

Terminal

Gnome Terminal

Originally created by @tqian86 on GitHub (Jan 4, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Since a recent update (probably around 1.0.20x), using OpenCode to edit any Python file will result in stylistic changes likely due to linting error messages. For example, PEP8 recommends using double quotes for strings, so all single quote strings are converted to double quotes. An example: ``` CACHE_TYPES = [ - 'simple', - 'filesystem', - 'redis', - 'redissentinel', - 'uwsgi', - 'memcached', - 'gaememcached', - 'saslmemcached', - 'spreadsaslmemcached', + "simple", + "filesystem", + "redis", + "redissentinel", + "uwsgi", + "memcached", + "gaememcached", + "saslmemcached", + "spreadsaslmemcached", ] ``` Also some frivious formatting changes like this: ``` - """ A cached resource with short expiration """ + """A cached resource with short expiration""" ``` or this: ``` -CACHE_BUSTING_METHODS = [ - 'POST', - 'PUT', - 'PATCH', - 'DELETE' -] +CACHE_BUSTING_METHODS = ["POST", "PUT", "PATCH", "DELETE"] ``` **Setting pyright to disabled in opencode.json has no effect on this behavior.** These changes are polluting the diff for existing projects. It is also difficult to prompt away this behavior. For example, grok code fast 1 doesn't seem to understand "make functional changes only. do not address formatting issues". ### Plugins _No response_ ### OpenCode version 1.1.1 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Debian 13 ### Terminal Gnome Terminal
yindo added the bug label 2026-02-16 17:42:58 -05:00
Author
Owner

@malhashemi commented on GitHub (Jan 4, 2026):

This seems like the effect of the built-in formatters

https://opencode.ai/docs/formatters/

Did you try disabling them?

@malhashemi commented on GitHub (Jan 4, 2026): This seems like the effect of the built-in formatters https://opencode.ai/docs/formatters/ Did you try disabling them?
Author
Owner

@rekram1-node commented on GitHub (Jan 4, 2026):

Yeah u can disable formatter to change this, maybe we should revert that pr tho

@rekram1-node commented on GitHub (Jan 4, 2026): Yeah u can disable formatter to change this, maybe we should revert that pr tho
Author
Owner

@tqian86 commented on GitHub (Jan 4, 2026):

ah thanks for the pointers! disabling the formatter does work!

yeah, from a ux perspective, it's a bit jarring to enable formatter as the default. Thanks for considering this!

@tqian86 commented on GitHub (Jan 4, 2026): ah thanks for the pointers! disabling the formatter does work! yeah, from a ux perspective, it's a bit jarring to enable formatter as the default. Thanks for considering this!
Author
Owner

@dogmatic69 commented on GitHub (Jan 28, 2026):

Also affected by this. Interesting choice to force on users by default. Defeats the purpose of telling the LLM to follow existing style rules.

@dogmatic69 commented on GitHub (Jan 28, 2026): Also affected by this. Interesting choice to force on users by default. Defeats the purpose of telling the LLM to follow existing style rules.
Author
Owner

@ting-ff commented on GitHub (Jan 28, 2026):

I completely agree. This should definitely be turned off by default.

Also affected by this. Interesting choice to force on users by default. Defeats the purpose of telling the LLM to follow existing style rules.

@ting-ff commented on GitHub (Jan 28, 2026): I completely agree. This should definitely be turned off by default. > Also affected by this. Interesting choice to force on users by default. Defeats the purpose of telling the LLM to follow existing style rules.
Author
Owner

@kristaller486 commented on GitHub (Feb 5, 2026):

@rekram1-node Is there any update on the decision to disable the auto-formatting feature by default? This feature really causes problems when using opencode on existing projects with their own coding style.

@kristaller486 commented on GitHub (Feb 5, 2026): @rekram1-node Is there any update on the decision to disable the auto-formatting feature by default? This feature really causes problems when using opencode on existing projects with their own coding style.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4189