]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/arcanist_util/lint_engine/FacebookHowtoevenLintEngine.php
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / arcanist_util / lint_engine / FacebookHowtoevenLintEngine.php
1 <?php
2 // Copyright 2015-present Facebook. All Rights Reserved.
3 // This source code is licensed under the BSD-style license found in the
4 // LICENSE file in the root directory of this source tree. An additional grant
5 // of patent rights can be found in the PATENTS file in the same directory.
6
7 final class FacebookHowtoevenLintEngine extends ArcanistLintEngine {
8
9 public function buildLinters() {
10 $paths = array();
11
12 foreach ($this->getPaths() as $path) {
13 // Don't try to lint deleted files or changed directories.
14 if (!Filesystem::pathExists($path) || is_dir($path)) {
15 continue;
16 }
17
18 if (preg_match('/\.(cpp|c|cc|cxx|h|hh|hpp|hxx|tcc)$/', $path)) {
19 $paths[] = $path;
20 }
21 }
22
23 $howtoeven = new FacebookHowtoevenLinter();
24 $howtoeven->setPaths($paths);
25 return array($howtoeven);
26 }
27 }