Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48277

Add an initial csslint config

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 2.7.4, 2.8.2
    • 2.7.3, 2.8, 2.9
    • Themes
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-48277-master
    • Hide

      (requires *nix based install)

      npm install -g csslint

      In the base of your moodle install:

      1. Run csslint --quiet --format=compact . | grep Error
      2. VERIFY: you can only see errors noted in the expected errors section below
      3. Run csslint --quiet --format=compact . | grep -v Error
      4. VERIFY: the warnings you see generally look sensible, but not overwhelming (considering its the entire codebase)
      Expected errors

      theme/(clean|more)/style/custom.css: IDENT errors
      Caused by our templates in there. Doesn't look to be a away round it except ignoring the whole files. I still think its useful to have these file checked, so we just have to expect the error (cibot will filter them too)

      base/style/course.css: line 576, col 14, Error - Duplicate property '*display' found.
      This looks like its an IE7 workaround to me, not touching for safety. (If anyone ever edits that line they can investigate)
      theme/base/style/filemanager.css: line 21, col 20, Error - Duplicate property 'filter' found
      theme/base/style/filemanager.css: line 21, col 118, Error - Duplicate property 'background' found.
      Looks like more crazy IE stuff, same as above

      Show
      (requires *nix based install) npm install -g csslint In the base of your moodle install: Run csslint --quiet --format=compact . | grep Error VERIFY: you can only see errors noted in the expected errors section below Run csslint --quiet --format=compact . | grep -v Error VERIFY: the warnings you see generally look sensible, but not overwhelming (considering its the entire codebase) Expected errors theme/(clean|more)/style/custom.css: IDENT errors Caused by our templates in there. Doesn't look to be a away round it except ignoring the whole files. I still think its useful to have these file checked, so we just have to expect the error (cibot will filter them too) base/style/course.css: line 576, col 14, Error - Duplicate property '*display' found. This looks like its an IE7 workaround to me, not touching for safety. (If anyone ever edits that line they can investigate) theme/base/style/filemanager.css: line 21, col 20, Error - Duplicate property 'filter' found theme/base/style/filemanager.css: line 21, col 118, Error - Duplicate property 'background' found. Looks like more crazy IE stuff, same as above

      CSSLint is a CSS linting tool which can be used to detect errors in CSS as well as enforce standards.

      At this time we do not have CSS guidelines (see MDLSITE-3612) however, the tool still can be of use to spot errors, typos, duplicate rules and this kind of thing.

      We can have these checks run by CiBot (MDLSITE-3612) and so this issue is about enabling an initial config which can be built upon as standards develop.

      Note the elephant in this room is 'less' - makes a lot of this less relevant (haha). But we are still maintaining our own css for base and plugins which still make this a worthwhile exercise (and perhaps more useful because there is less everyday testing going on).

            poltawski Dan Poltawski
            poltawski Dan Poltawski
            Sam Hemelryk Sam Hemelryk
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.