CHORE: officially renamed files to be deprecated and also made making
templates simpler
This commit is contained in:
@@ -1,29 +1,18 @@
|
||||
local M = {}
|
||||
|
||||
M.main = function(opts)
|
||||
local template = [=[
|
||||
return {
|
||||
main = vim.trim([=[
|
||||
def main() -> None:
|
||||
print("Hello from %s!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
]=]
|
||||
return string.format(template, opts)
|
||||
end
|
||||
|
||||
M.__init__ = function(opts)
|
||||
local template = [=[
|
||||
# %s
|
||||
]=]),
|
||||
__init__ = vim.trim([=[
|
||||
# %s init
|
||||
|
||||
__all__: list[str] = []
|
||||
]=]
|
||||
return string.format(template, opts.project_name)
|
||||
end
|
||||
|
||||
M.pyproject = function(opts)
|
||||
local n = opts.project_name
|
||||
local template = [=[
|
||||
]=]),
|
||||
pyproject = vim.trim([=[
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
@@ -38,17 +27,11 @@ dependencies = []
|
||||
|
||||
[project.scripts]
|
||||
%s = "%s.main:main"
|
||||
]=]
|
||||
return string.format(template, n, n, n, n)
|
||||
end
|
||||
|
||||
M.module = function(opts)
|
||||
local template = [=[
|
||||
]=]),
|
||||
module = vim.trim([=[
|
||||
"""
|
||||
%s module
|
||||
Module: %s
|
||||
"""
|
||||
]=]
|
||||
return string.format(template, opts)
|
||||
end
|
||||
|
||||
return M
|
||||
]=]),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user