feat(aa-log): format rule before print.

This commit is contained in:
Alexandre Pujol 2023-10-01 19:00:39 +01:00
parent 352c444ae6
commit b99bb8da46
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
7 changed files with 73 additions and 34 deletions

View file

@ -19,10 +19,7 @@
{{ end -}}
{{- range .Variables -}}
{{ "@{" }}{{ .Name }}{{ "} = " }}
{{- range .Values -}}
{{ . }}{{ " " }}
{{- end }}
{{ "@{" }}{{ .Name }}{{ "} = " }}{{ join .Values }}
{{ end -}}
{{- "profile" -}}
@ -43,6 +40,10 @@
{{- $oldtype := "" -}}
{{- range .Rules -}}
{{- $type := typeof . -}}
{{- if eq $type "Rule" -}}
{{- "\n" -}}
{{- continue -}}
{{- end -}}
{{- if and (ne $type $oldtype) (ne $oldtype "") -}}
{{- "\n" -}}
{{- end -}}
@ -217,7 +218,12 @@
{{- if eq $type "File" -}}
{{- template "qualifier" . -}}
{{ .Path }}{{ " " }}{{ .Access }}
{{- .Path -}}
{{- " " -}}
{{- with .Padding -}}
{{ . }}
{{- end -}}
{{- .Access -}}
{{- with .Target -}}
{{ " -> " }}{{ . }}
{{- end -}}

View file

@ -1,4 +1,7 @@
{{- define "qualifier" -}}
{{- with .Prefix -}}
{{ . }}
{{- end -}}
{{- if .Owner -}}
{{- "owner " -}}
{{- end -}}