#
# linter.py
# Linter for SublimeLinter4, a code checking framework for Sublime Text 3
#
# Written by Jack Cherng
# Copyright (c) 2017-2019 jfcherng
#
# License: MIT
#

from SublimeLinter.lint import Linter
import sublime


class Iverilog(Linter):
    # http://www.sublimelinter.com/en/stable/linter_attributes.html
    name = "iverilog"
    cmd = "iverilog ${args}"
    tempfile_suffix = "verilog"
    multiline = True
    on_stderr = None

    # fmt: off
    defaults = {
        "selector": "source.verilog | source.systemverilog",
        "-t": "null",
        "-g": 2012,
        "-I +": [],
        "-y +": [],
    }
    # fmt: on

    # there is a ":" in the filepath under Windows like C:\DIR\FILE
    if sublime.platform() == "windows":
        filepath_regex = r"[^:]+:[^:]+"
    else:
        filepath_regex = r"[^:]+"

    # what kind of messages should be caught?
    regex = (
        r"(?P<file>{0}):(?P<line>\d+):\s*"
        r"(?:(?:(?P<warning>warning)|(?P<error>error)):)?\s*"
        r"(?P<message>.*)".format(filepath_regex)
    )

#
# linter.py
# Linter for SublimeLinter4, a code checking framework for Sublime Text 3
#
# Written by Jack Cherng
# Copyright (c) 2017-2019 jfcherng
#
# License: MIT
#

from SublimeLinter.lint import Linter
import sublime


class Iverilog(Linter):
    # http://www.sublimelinter.com/en/stable/linter_attributes.html
    name = "iverilog"
    cmd = "iverilog ${args}"
    tempfile_suffix = "verilog"
    multiline = True
    on_stderr = None

    # fmt: off
    defaults = {
        "selector": "source.verilog | source.systemverilog",
        # @see https://iverilog.fandom.com/wiki/Iverilog_Flags
        "-t": "null",
        "-g": 2012,
        "-I +": [],
        "-y +": [],
    }
    # fmt: on

    # there is a ":" in the filepath under Windows like C:\DIR\FILE
    if sublime.platform() == "windows":
        filepath_regex = r"[^:]+:[^:]+"
    else:
        filepath_regex = r"[^:]+"

    # what kind of messages should be caught?
    regex = (
        r"(?P<file>{0}):(?P<line>\d+):\s*"
        r"(?:(?:(?P<warning>warning)|(?P<error>error)):)?\s*"
        r"(?P<message>.*)".format(filepath_regex)
    )

Add iverilog flags reference URL
Add iverilog flags reference URL

Signed-off-by: Jack Cherng <159f0f32a62cc912ca55f89bb5e06807cf019bc7@gmail.com>
