<commit_before>from . import ev

DOMAIN = 'GoSublime: Lint'

def gs_init(m={}):
	pass

def lc(view):
	pass

def mod(view):
	pass<commit_msg>* impl the minimal line/note functions<commit_after>from . import ev
from . import gs
from . import kv

DOMAIN = 'GoSublime: Lint'
STATUS_DOMAIN = 'gs-lint-status'

kvs = kv.M()

class Pos(object):
	def __init__(self, row, col):
		self.row = row
		self.col = col

class Note(object):
	def __init__(self, ctx, pos, message):
		self.ctx = ctx
		self.pos = pos
		self.message = message

def df_kvm():
	return (kv.M(), True)

def kvm(view):
	return kvs.get(gs.view_fn(view), df_kvm)

def notes(view):
	return kvm(view).values()

def row_notes(view, row):
	return kvm(view).get(row, df_note_set)

def add_note(view, n):
	# todo: fix this race? does it actually matter?
	kvm(view).get(n.pos.row, df_note_set).add(n)
	lc(view)

def df_note_set():
	return (set(), True)

def clear_notes(view, ctx):
	kvm(view).filter(lambda _, ns: set((n for n in ns if n.ctx != ctx)))
	lc(view)

def gs_init(m={}):
	pass

def lc(view):
	sel = gs.sel(view)
	row, _ = view.rowcol(sel.begin())
	m = kvm(view)

	s = ''
	l = len(m)
	if l > 0:
		n = None
		ns = m.get(row)
		if ns:
			for v in ns:
				n = v
				if n:
					s = ' %s: %s' % (n.ctx, n.message)
					break

		s = u'\u2622%s' % s

	view.set_status(STATUS_DOMAIN, s)

def mod(view):
	pass
{'fraction_non_alphanumeric': 0.16188373804267844, 'fraction_numerical': 0.003679175864606328, 'mean_word_length': 3.473684210526316, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1249220', 'n_tokens_mistral': 623, 'n_tokens_neox': 591, 'n_words': 156}