Data structures passed to the template that end up being used later should not have any set methods and should be opaque or cloned if they are a dict or list etc.
Additionally, all template functions that return structures specifically for modification by the template should prefer dicts, lists, etc. where possible, and structs with public setters for situations where that wouldnt be ideal.
Data structures passed to the template that end up being used later should not have any set methods and should be opaque or cloned if they are a dict or list etc.
Additionally, all template functions that return structures specifically *for* modification by the template should prefer dicts, lists, etc. where possible, and structs with public setters for situations where that wouldnt be ideal.
sashakoshka
changed title from Ensure data passed to templates is immutable unless needed to Ensure data passed to templates is immutable unless otherwise needed2024-12-16 16:27:10 -07:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Data structures passed to the template that end up being used later should not have any set methods and should be opaque or cloned if they are a dict or list etc.
Additionally, all template functions that return structures specifically for modification by the template should prefer dicts, lists, etc. where possible, and structs with public setters for situations where that wouldnt be ideal.
Ensure data passed to templates is immutable unless neededto Ensure data passed to templates is immutable unless otherwise needed