Visual Studio Code

From Torben's Wiki
Jump to navigationJump to search

user settings

   "telemetry.enableTelemetry": false,
   "telemetry.enableCrashReporter": false,
   "editor.formatOnSave": true,
   "editor.minimap.enabled": false,
   "editor.wordWrap": "on",
   "files.eol": "\n",
   // "editor.tabSize": 2,
   // Perl
   // perl.perltidy not used via Module Perl, but via module perltity, so commented here!
   "perltidy.additionalArguments": [ // see
       "--standard-output", // -so
       "--quiet", // -q Deactivate error messages and syntax checking (for running under an editor)
       "--perl-best-practices", // -pbp abbreviation for the parameters in the book Perl Best Practices by Damian Conway
       "--indent-columns=2", // -ic does not work in vis.stutio code , but editor.tabSize does
       "--cuddled-else", // -ce
       "--opening-brace-always-on-right", // -bar
       "--paren-tightness=0", // -pt parentheses thickness
       "--brace-tightness=0", // -bt braces thickness
       "--square-bracket-tightness=0", // -sbt square brackets thickness
       "--maximum-line-length=0", // -l , 0 = infinite
       "--add-whitespace", // -aws add white spaces, use -naws if you do not want any whitespace added, but are willing to have some whitespace deleted 
       "--delete-old-whitespace", // -dws default
       "--blank-lines-before-subs=2", // -blbs
       "--noblanks-before-comments", // -nbbc , opposite: --blanks-before-comments=2 / -bbc
       "--maximum-consecutive-blank-lines=1", // -mbl
       "--keep-old-blank-lines=1", //-kbl, 0=ignore, 1=stable, 2=keep
       "--ignore-side-comment-lengths", // comments are allowed to be longer than the lines of code
       "--closing-side-comments", // adds "## end sub subname etc"
       //        "--nohanging-side-comments",
   "perl-toolbox.syntax.path": "e:\\win\\progs\\Perl\\perl\\bin",
   "perl-toolbox.lint.path": "e:\\win\\progs\\Perl\\cpan\\build\\Perl-Critic-1.132-bGUV8E\\bin",
   "perl-toolbox.lint.excludedPolicies": [
       "RequireExplicitPackage", // don't require package as first line 
       "ValuesAndExpressions::ProhibitInterpolationOfLiterals", // check use of ' vs "
       "NamingConventions::Capitalization", // var. names all capital or all lower case 
       "InputOutput::RequireCheckedSyscalls", // Lint: BRUTAL: Return value of flagged function ignored - print
       "ErrorHandling::RequireCarping", // die used instead of croak
       "ProhibitParensWithBuiltins", // don't complain if using () for buildin functions like open
       "ProhibitNoisyQuotes", // don't complain if using 1 char strings: $s = 'a'
       "ProhibitEmptyQuotes", // don't complain if using $s = 
       "ProhibitPunctuationVars", // don't complain if using $!
       "RequireDotMatchAnything", // don't complain Regular expression without "/s" flag
       "RequireLineBoundaryMatching", // don't complain Regular expression without "/s" flag
       "RequireExtendedFormatting", // don't complain Regular expression without "/x" flag
       "ProhibitMagicNumbers", // don't complain $n = 14
       "ProhibitPostfixControls", // don't complain for $n ++ if <something>
       "ProhibitManyArgs", // don't care how many arguments a function has
       "RequireTidyCode", // don't complain on first line if not all of Perl::Tidy is met
   "[perl]": {
       "editor.defaultFormatter": "sfodje.perltidy"
   // Python
   "python.formatting.provider": "autopep8",
   "python.jediEnabled": false,
   // "python.pythonPath": "/usr/local/opt/python/bin/python3.7",
   "python.linting.pylintArgs": [
   "python.autoComplete.addBrackets": true,
   // Git
   "git.autofetch": true,
   "git.enableSmartCommit": true,
   "git.confirmSync": false,
   // HTML
   "html.format.wrapLineLength": 0,
   "html.format.maxPreserveNewLines": 2,
   "html.format.preserveNewLines": false,
   "html.format.extraLiners": "head, body, /html, p, h1, h2, h3, h4, h5, h6"

see Perl -> Perltidy Parameters



Formatting and Linting Tools required

  • perltidy
  • perlcritic


  • Python

Formatting and Linting Tools

  • pip install autopep8
  • pip install pylint


  • HTMLHint