sublimetext3sublimelinter

SublimeLinter "max-line-length" setting not applied


I'm having difficulty setting user settings for SublimeLinter in SublimeText3. I've checked here: http://www.sublimelinter.com/en/latest/settings.html

I've tried setting my user settings, and setting "max-line-length" to 80 (the default is 100):

{
    "user": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "linters": {
            "pylint": {
                "@disable": false,
                "args": [],
                "disable": "",
                "enable": "",
                "excludes": [],
                "max-line-length": 80,
                "paths": [],
                "rcfile": "",
                "show-codes": false
            }
        },
        "mark_style": "outline",
        "no_column_highlights_line": true,
        "passive_warnings": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "html (django)": "html",
            "html (rails)": "html",
            "html 5": "html",
            "php": "html",
            "python django": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}

However, this setting is not applied. I have closed and re-opened sublime text. How do I get this setting to be applied? Thanks.


Solution

  • The syntax you are using seems to work for some linters, however, as far as I know it doesn't works for pylint.

    Anyway, for using pylint from Sublime Text you can use the command argument --max-line-length=N, so change

    "args": []
    

    for

    "args": ["--max-line-length=90"]
    

    In addition, if you do this, remove the max-line-length property.


    Edit: where to place SublimeLinter settings.

    You can learn about it in the SublimeLinter settings documentation

    I used the user-settings-file, that you can usually find using the following menu option: Preferences > Package Settings > SublimeLinter > Settings-User. For this purpose you need to add the option inside linters/pylint:

    {
        "user": {
            "linters": {
                "pylint": {
                    // "exampleOtion": "exampleValue",
                    "args": ["--max-line-length=90"]
                }
            }
        }
    }
    

    Please note that probably your config file is similar to the one in the question, so you just need to add the new option inside "pylint" without breaking the JSON format