Skip to:
Content

BuddyPress.org

Ticket #7028: 7028.1-tooling.patch

File 7028.1-tooling.patch, 11.8 KB (added by netweb, 4 years ago)
  • .scss-lint.yml

     
    1 # Default application configuration that all configurations inherit from.
    2 
    3 scss_files: "**/*.scss"
    4 
    5 linters:
    6   BangFormat:
    7     enabled: true
    8     space_before_bang: true
    9     space_after_bang: false
    10 
    11   BorderZero:
    12     enabled: true
    13     convention: zero # or `none`
    14 
    15   ColorKeyword:
    16     enabled: true
    17 
    18   ColorVariable:
    19     enabled: false
    20 
    21   Comment:
    22     enabled: false
    23 
    24   DebugStatement:
    25     enabled: true
    26 
    27   DeclarationOrder:
    28     enabled: false
    29 
    30   DuplicateProperty:
    31     enabled: false
    32 
    33   ElsePlacement:
    34     enabled: true
    35     style: same_line # or 'new_line'
    36 
    37   EmptyLineBetweenBlocks:
    38     enabled: true
    39     ignore_single_line_blocks: true
    40 
    41   EmptyRule:
    42     enabled: true
    43 
    44   FinalNewline:
    45     enabled: true
    46     present: true
    47 
    48   HexLength:
    49     enabled: true
    50     style: short # or 'long'
    51 
    52   HexNotation:
    53     enabled: true
    54     style: lowercase # or 'uppercase'
    55 
    56   HexValidation:
    57     enabled: true
    58 
    59   IdSelector:
    60     enabled: false
    61 
    62   ImportantRule:
    63     enabled: false
    64 
    65   ImportPath:
    66     enabled: true
    67     leading_underscore: false
    68     filename_extension: false
    69 
    70   Indentation:
    71     enabled: true
    72     allow_non_nested_indentation: false
    73     character: tab # or 'space'
    74     width: 1
    75 
    76   LeadingZero:
    77     enabled: true
    78     style: include_zero # or 'include_zero'
    79 
    80   MergeableSelector:
    81     enabled: false
    82     force_nesting: true
    83 
    84   NameFormat:
    85     enabled: true
    86     allow_leading_underscore: true
    87     convention: hyphenated_lowercase # or 'BEM', or a regex pattern
    88 
    89   NestingDepth:
    90     enabled: true
    91     max_depth: 7
    92 
    93   PlaceholderInExtend:
    94     enabled: true
    95 
    96   PropertyCount:
    97     enabled: false
    98     include_nested: false
    99     max_properties: 10
    100 
    101   PropertySortOrder:
    102     enabled: true
    103     ignore_unspecified: false
    104     separate_groups: false
    105 
    106   PropertySpelling:
    107     enabled: true
    108     extra_properties: []
    109 
    110   PseudoElement:
    111     enabled: false
    112 
    113   QualifyingElement:
    114     enabled: false
    115     allow_element_with_attribute: false
    116     allow_element_with_class: false
    117     allow_element_with_id: false
    118 
    119   SelectorDepth:
    120     enabled: true
    121     max_depth: 6
    122 
    123   SelectorFormat:
    124     enabled: true
    125     convention: hyphenated_lowercase # or 'BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern
    126     ignored_names: ['signup_form', 'send_message_form', 'ac_results']
    127 
    128   Shorthand:
    129     enabled: false
    130 
    131   SingleLinePerProperty:
    132     enabled: true
    133     allow_single_line_rule_sets: true
    134 
    135   SingleLinePerSelector:
    136     enabled: true
    137 
    138   SpaceAfterComma:
    139     enabled: true
    140 
    141   SpaceAfterPropertyColon:
    142     enabled: true
    143     style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
    144 
    145   SpaceAfterPropertyName:
    146     enabled: true
    147 
    148   SpaceBeforeBrace:
    149     enabled: true
    150     style: space # or 'new_line'
    151     allow_single_line_padding: false
    152 
    153   SpaceBetweenParens:
    154     enabled: true
    155     spaces: 0
    156 
    157   StringQuotes:
    158     enabled: true
    159     style: double_quotes
    160 
    161   TrailingSemicolon:
    162     enabled: true
    163 
    164   TrailingZero:
    165     enabled: false
    166 
    167   UnnecessaryMantissa:
    168     enabled: true
    169 
    170   UnnecessaryParentReference:
    171     enabled: true
    172 
    173   UrlFormat:
    174     enabled: true
    175 
    176   UrlQuotes:
    177     enabled: true
    178 
    179   VariableForProperty:
    180     enabled: false
    181     properties: []
    182 
    183   VendorPrefix:
    184     enabled: true
    185     identifier_list: base
    186     additional_identifiers: []
    187     excluded_identifiers: []
    188 
    189   ZeroUnit:
    190     enabled: true
    191 
    192   Compass::*:
    193     enabled: false
  • .stylelintrc

     
     1{
     2"rules": {
     3  "at-rule-empty-line-before": [ "always", {
     4    except: ["blockless-group"],
     5    ignore: ["after-comment"],
     6  } ],
     7  "at-rule-name-case": "lower",
     8  "at-rule-name-space-after": "always-single-line",
     9  "at-rule-no-unknown": true,
     10  "at-rule-semicolon-newline-after": "always",
     11  "block-closing-brace-newline-after": "always",
     12  "block-closing-brace-newline-before": "always",
     13  "block-opening-brace-newline-after": "always",
     14  "block-opening-brace-space-before": "always",
     15  "color-hex-case": "lower",
     16  "color-hex-length": "short",
     17  "color-named": "never",
     18  "color-no-invalid-hex": true,
     19  "comment-empty-line-before": [ "always", {
     20    ignore: ["stylelint-commands"],
     21  } ],
     22  "declaration-bang-space-after": "never",
     23  "declaration-bang-space-before": "always",
     24  "declaration-block-no-duplicate-properties": [ true, {
     25    ignore: ["consecutive-duplicates"],
     26  } ],
     27  "declaration-block-no-shorthand-property-overrides": true,
     28  "declaration-block-semicolon-newline-after": "always",
     29  "declaration-block-semicolon-space-before": "never",
     30  "declaration-block-trailing-semicolon": "always",
     31  "declaration-colon-newline-after": "always-multi-line",
     32  "declaration-colon-space-after": "always-single-line",
     33  "declaration-colon-space-before": "never",
     34  "font-family-name-quotes": "always-where-recommended",
     35  "font-weight-notation": "numeric",
     36  "function-calc-no-unspaced-operator": true,
     37  "function-comma-space-after": "always",
     38  "function-comma-space-before": "never",
     39  "function-linear-gradient-no-nonstandard-direction": true,
     40  "function-max-empty-lines": 1,
     41  "function-name-case": "lower",
     42  "function-parentheses-space-inside": "never",
     43  "function-url-quotes": "never",
     44  "function-whitespace-after": "always",
     45  "indentation": "tab",
     46  "keyframe-declaration-no-important": true,
     47  "length-zero-no-unit": true,
     48  "max-empty-lines": 2,
     49  "max-line-length": [ 80, {
     50    "ignore": "non-comments",
     51  } ],
     52  "media-feature-colon-space-after": "always",
     53  "media-feature-colon-space-before": "never",
     54  "media-feature-no-missing-punctuation": true,
     55  "media-feature-range-operator-space-after": "always",
     56  "media-feature-range-operator-space-before": "always",
     57  "media-query-list-comma-newline-after": "always-multi-line",
     58  "media-query-list-comma-space-after": "always-single-line",
     59  "media-query-list-comma-space-before": "never",
     60  "no-eol-whitespace": true,
     61  "no-extra-semicolons": true,
     62  "no-invalid-double-slash-comments": true,
     63  "no-missing-end-of-source-newline": true,
     64  "number-leading-zero": "always",
     65  "number-no-trailing-zeros": true,
     66  "property-case": "lower",
     67  "property-no-unknown": true,
     68  "rule-nested-empty-line-before": [ "always", {
     69    ignore: ["after-comment"],
     70  } ],
     71  "rule-non-nested-empty-line-before": [ "always", {
     72    ignore: ["after-comment"],
     73  } ],
     74  "selector-attribute-brackets-space-inside": "never",
     75  "selector-attribute-operator-space-after": "never",
     76  "selector-attribute-operator-space-before": "never",
     77  "selector-attribute-quotes": "always",
     78  "selector-class-pattern": [
     79    "^[a-z]+(-[a-z]+)*",
     80    {
     81    "message": "Selector should use lowercase and separate words with hyphens (selector-class-pattern)",
     82    },
     83  ],
     84  "selector-id-pattern": [
     85    "^[a-z]+(-[a-z]+)*",
     86    {
     87    "message": "Selector should use lowercase and separate words with hyphens (selector-id-pattern)",
     88    },
     89  ],
     90  "selector-combinator-space-after": "always",
     91  "selector-combinator-space-before": "always",
     92  "selector-list-comma-newline-after": "always",
     93  "selector-list-comma-space-before": "never",
     94  "selector-max-empty-lines": 0,
     95  "selector-pseudo-class-case": "lower",
     96  "selector-pseudo-class-no-unknown": true,
     97  "selector-pseudo-class-parentheses-space-inside": "never",
     98  "selector-pseudo-element-case": "lower",
     99  "selector-pseudo-element-colon-notation": "single",
     100  "selector-pseudo-element-no-unknown": true,
     101  "selector-type-case": "lower",
     102  "selector-type-no-unknown": true,
     103  "shorthand-property-no-redundant-values": true,
     104  "string-no-newline": true,
     105  "string-quotes": "double",
     106  "unit-case": "lower",
     107  "unit-no-unknown": true,
     108  "value-keyword-case": "lower",
     109  "value-list-comma-newline-after": "always-multi-line",
     110  "value-list-comma-space-after": "always-single-line",
     111  "value-list-comma-space-before": "never"
     112  }
     113}
  • .travis.yml

     
    99cache:
    1010  apt: true
    1111  directories:
    12     - $HOME/.composer/cache
    13     - $HOME/.rvm/gems
     12    - $HOME/.composer/cache]
    1413#    - /tmp/wordpress/src/wp-content/plugins/buddypress/node_modules
    1514
    1615php:
     
    5958
    6059# before_install: Failures in this section will result in build status 'errored'
    6160before_install:
    62   # scss-lint requires Ruby >= 2.2
    63   - source ~/.rvm/scripts/rvm && rvm install 2.2.0 && rvm use 2.2.0
    6461  # set up WP install
    6562  - export WP_DEVELOP_DIR=/tmp/wordpress/
    6663  - mkdir -p $WP_DEVELOP_DIR
     
    8279  - mysql -e 'CREATE DATABASE wordpress_test;' -uroot
    8380  # prepare for running the tests
    8481  - cd $plugin_dir
    85   - gem install scss_lint
    8682  # setup NodeJS version using NVM
    8783  - node --version
    8884  - nvm install 4
     
    9187  - npm --version
    9288  - mysql --version
    9389  - phpenv versions
    94   - ruby --version
    9590
    9691# before_script: Failures in this section will result in build status 'errored'
    9792before_script:
  • Gruntfile.js

     
    7575                                }
    7676                        }
    7777                },
     78                stylelint: {
     79                        css: {
     80                                options: {
     81                                        configFile: '.stylelintrc',
     82                                        format: 'css'
     83                                },
     84                                expand: true,
     85                                cwd: SOURCE_DIR,
     86                                src: BP_CSS.concat( BP_EXCLUDED_CSS, BP_EXCLUDED_MISC )
     87                        },
     88                        scss: {
     89                                options: {
     90                                        configFile: '.stylelintrc',
     91                                        format: 'scss'
     92                                },
     93                                expand: true,
     94                                cwd: SOURCE_DIR,
     95                                src: [ 'bp-templates/bp-legacy/css/*.scss' ]
     96                        }
     97                },
    7898                sass: {
    7999                        styles: {
    80100                                cwd: SOURCE_DIR,
     
    193213                                src: BP_JS
    194214                        }
    195215                },
    196                 scsslint: {
    197                         options: {
    198                                 bundleExec: false,
    199                                 colorizeOutput: true,
    200                                 config: '.scss-lint.yml'
    201                         },
    202                         core: [ SOURCE_DIR + 'bp-templates/bp-legacy/css/*.scss' ]
    203                 },
    204216                cssmin: {
    205217                        minify: {
    206218                                cwd: BUILD_DIR,
     
    270282        /**
    271283         * Register tasks.
    272284         */
    273         grunt.registerTask( 'src',     ['checkDependencies', 'jsvalidate:src', 'jshint', 'scsslint', 'sass', 'rtlcss'] );
     285        grunt.registerTask( 'src',     ['checkDependencies', 'jsvalidate:src', 'jshint', 'stylelint', 'sass', 'rtlcss'] );
    274286        grunt.registerTask( 'commit',  ['src', 'checktextdomain', 'imagemin'] );
    275287        grunt.registerTask( 'build',   ['commit', 'clean:all', 'copy:files', 'uglify', 'jsvalidate:build', 'cssmin', 'makepot', 'exec:bpdefault'] );
    276288        grunt.registerTask( 'release', ['build', 'exec:bbpress'] );
  • package.json

     
    66  "description": "BuddyPress helps site builders and WordPress developers add community features to their websites, with user profile fields, activity streams, messaging, and notifications.",
    77  "devDependencies": {
    88    "grunt": "~1.0.1",
     9    "grunt-check-dependencies": "~0.12.0",
    910    "grunt-checktextdomain": "~1.0.0",
    1011    "grunt-contrib-clean": "~1.0.0",
    1112    "grunt-contrib-copy": "~1.0.0",
     
    1516    "grunt-contrib-uglify": "~2.0.0",
    1617    "grunt-contrib-watch": "~1.0.0",
    1718    "grunt-exec": "~1.0.0",
    18     "grunt-check-dependencies": "~0.12.0",
    1919    "grunt-jsvalidate": "~0.2.2",
    2020    "grunt-legacy-util": "^1.0.0",
    2121    "grunt-patch-wordpress": "~0.4.0",
    2222    "grunt-rtlcss": "~2.0.1",
    2323    "grunt-sass": "~1.2.0",
    2424    "grunt-scss-lint": "~0.3.8",
     25    "grunt-stylelint": "^0.6.0",
    2526    "grunt-wp-i18n": "~0.5.3",
    26     "matchdep": "~1.0.0"
     27    "matchdep": "~1.0.0",
     28    "postcss-scss": "^0.3.0",
     29    "stylelint": "^7.3.1"
    2730  },
    2831  "engines": {
    2932    "node": ">=4.2.1"