func()

in rules/resource_block.go [155:178]


func (b *ResourceBlock) sectionsSorted() bool {
	sections := []Section{
		b.HeadMetaArgs,
		b.Args,
		b.NestedBlocks,
		b.TailMetaArgs,
		b.TailMetaNestedBlocks,
	}
	lastEndLine := -1
	for _, s := range sections {
		if !s.CheckOrder() {
			return false
		}
		r := s.GetRange()
		if r == nil {
			continue
		}
		if r.Start.Line <= lastEndLine {
			return false
		}
		lastEndLine = r.End.Line
	}
	return true
}