mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Add import
This commit is contained in:
parent
855f79cc72
commit
be316cafab
@ -1,3 +1,3 @@
|
|||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
patterns:
|
patterns:
|
||||||
# - name: github.com/getgrit/stdlib#*
|
- name: github.com/getgrit/stdlib#*
|
||||||
|
@ -15,7 +15,7 @@ pattern refactor_functions($config_entry_type, $file_name, $config_entry_type_de
|
|||||||
$type <: type(type="ConfigEntry"),
|
$type <: type(type="ConfigEntry"),
|
||||||
$type => $config_entry_type,
|
$type => $config_entry_type,
|
||||||
if ($file_name <: not `__init__`) {
|
if ($file_name <: not `__init__`) {
|
||||||
//$config_entry_type <: ensure_import_from(source = `.`),
|
$config_entry_type <: ensure_import_from(source = `.`),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -63,13 +63,15 @@ multifile {
|
|||||||
},
|
},
|
||||||
$domain_list += $domain,
|
$domain_list += $domain,
|
||||||
},
|
},
|
||||||
bubble($domain_list) file($name, $body) where {
|
bubble($domain_list) file($name, $body) as $file where {
|
||||||
|
$file <: before_each_file(),
|
||||||
// migrate files
|
// migrate files
|
||||||
$filename <: r".*components/([^/]+)/([^/]+)\.py$"($domain, $file_name),
|
$filename <: r".*components/([^/]+)/([^/]+)\.py$"($domain, $file_name),
|
||||||
$domain_list <: includes $domain,
|
$domain_list <: includes $domain,
|
||||||
$config_entry_type = capitalize($domain),
|
$config_entry_type = capitalize($domain),
|
||||||
$config_entry_type += "ConfigEntry",
|
$config_entry_type += "ConfigEntry",
|
||||||
$body <: contains refactor_functions($config_entry_type, $file_name, $config_entry_type_defined),
|
$body <: contains refactor_functions($config_entry_type, $file_name, $config_entry_type_defined),
|
||||||
|
$file <: after_each_file()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
Loading…
x
Reference in New Issue
Block a user