Fix Utils module to not expect arguments for inspect
Author: bkuhlmannCreated Jul 17, 2026Updated Jul 20, 2026
Why
Hello. :wave:
The Liquid::Utils.inspect method expects an object argument but, when not given, it'll throw an ArgumentError. This violates the Liskov Substitution Principle becauseObject (superclass) does not require you pass in any arguments.
How
To fix, can the method signature be something like this?
self.inspect object = nil, seen = {}This would allow object to be optional instead of requried.
Notes
I tried monkey patching with nil but ended up with different spec failures so not sure what the default expectation is here but this definitely causes specs to fail in CI when using SimpleCov 1.0.0. Although, when running locally, I could not recreate this.
Source: Shopify/liquid