Commit Graph

507 Commits

Author SHA1 Message Date
Mark Mentovai
58e2a524cd
Merge pull request #293 from iam/cpplint_quiet
cpplint: add --quiet flag to suppress all output when there's no errors
2017-11-10 17:54:14 -05:00
Igor Murashkin
e8ffd7ce60 cpplint: add --quiet flag to suppress all output when there's no errors
Example:

   cpplint.py --quiet <file-names>

Will now return with an exit code of 0 and return empty output if there
were no errors. This makes it particularly useful to be driven by a build system
such as makefiles or gradle.

In particular, these messages are now suppressed:

  Ignoring <filename>, excluded by CPPLINT.cfg, ...
  Done processing <filename>
  Total errors found: 0

If there were any errors, the above messages are printed nevertheless.

There is no behavior change if --quiet is not passed in.
2017-11-10 14:23:35 -08:00
Mark Mentovai
8667623865
Merge pull request #292 from iam/root_cpplint_cfg
CPPLINT.cfg root=setting is now relative to CFG file.
2017-11-09 23:10:53 -05:00
Igor Murashkin
8a87a46cc7 CPPLINT.cfg root=setting is now relative to CFG file.
Also further improve the documentation and testing around --root.

Previously the root=setting in the CFG file was treated identically
to passing --root=setting on the command line, which seems undesirable
since it depends on were cpplint.cfg was invoked from (for relative
paths).

Judging on settings such as 'exclude_files' it seems within the spirit
to make the settings 'current working directory' contextual to the
same directory that CPPLINT.cfg is in.

This also makes execution consistent (picking up the "correct" settings)
regardless of the CWD when executing cpplint.py.

Example:

  echo 'root=..' >> /a/b/c/CPPLINT.cfg
  cd /
  cpplint.py /a/b/c/source_file.h
  # expects header guard of C_SOURCE_FILE_H_

However the old behavior would use '/../' = '/'
and incorrectly think the root was 'A_B_C_SOURCE_FILE_H_'.
2017-11-09 16:36:27 -08:00
Mark Mentovai
d9e5e4dcb6
Merge pull request #291 from iam/root_flag_outer_directory
cpplint: --root now supports non-subdirectories
2017-11-08 17:36:27 -05:00
Igor Murashkin
e7ddd2af62 cpplint --root: support non-subdirectories
Using cpplint.py --root with directories at a more outer level
will now prepend the header guard with all the directories from the
root to the file.

For example given

  ls /a/b/c # /a/b/c/.git /a/b/c/filename.h
  cpplint.py --root=/a/b /a/b/c/filename.h   # C_FILENAME_H_

  # no root behavior:
  cpplint.py /a/b/c/filename.h               # FILENAME_H_

Also supports relative paths:

  cd /a/b/c
  cpplint.py --root=.. filename.h            # C_FILENAME_H_

Note that the old usage is still supported:

  cd /a/b/c
  mkdir -p d/e/f
  touch /a/b/c/d/e/f/filename.h
  cpplint.py --root=d/e/f d/e/f/filename.h   # FILENAME_H_

which would "strip" the prefix rather than prepend an extra prefix.

(Invalid root prefixes are as before also ignored)
2017-11-08 14:33:52 -08:00
Mark Mentovai
66f0d44381
Merge pull request #290 from google/revert-289-gh-pages
Revert "cpplint: Fix --root for non-subdirectories"
2017-11-08 13:18:12 -05:00
Mark Mentovai
d420095c75
Revert "cpplint: Fix --root for non-subdirectories" 2017-11-08 13:17:45 -05:00
Mark Mentovai
81ceafcd9d
Merge pull request #289 from iam/gh-pages
cpplint: Fix --root for non-subdirectories
2017-11-08 13:17:19 -05:00
Igor Murashkin
a38fcbb5b0 cpplint: Fix --root for non-subdirectories
Using cpplint.py --root with directories at a more outer level
than the repository would not work.

For example given

  /a/b/c/.git/filename.cpp

Trying to use --root=/a/b would get ignored, and it would
ask for a headerguard of FILENAME_H_ instead of C_FILENAME_H_
as expected.

Now --root will always use the "full name" and then strip off --root
prefix, giving us the desired effect.
2017-11-06 15:00:05 -08:00
Kevin Lindkvist
ec88ff999b Merge pull request #285 from google/update-objc
[objc] Update the Objective-C style guide 📜
2017-10-18 18:03:12 -07:00
Stephane Moore
4264801ce6 [objc] Update the Objective-C style guide 📜
Revision Date: 10/16/2017
2017-10-16 18:11:48 -07:00
Liam Miller-Cushon
911d9f4a7e Update Java style guide 2017-09-29 17:19:34 -07:00
Stephen Hicks
520cd9f88c Update intellij-java-google-style.xml
Fixes #252
Fixes #253
2017-09-07 11:59:01 -07:00
Donatas Kučinskas
f6a1ee14e1 Update eclipse-java-google-style (#271)
Remove blank lines between import groups to use [code style] (https://google.github.io/styleguide/javaguide.html#s3.3.3-import-ordering-and-spacing).

Fixes #270
2017-09-05 15:27:04 -07:00
Rommel M. Martinez
15afe031f1 Fix a typo 2017-09-05 15:22:44 -07:00
Stephane Moore
ef4219f259 Merge pull request #268 from google/objc-xml-linking
[objc] Make objcguide.xml link to objcguide.md 🔄
2017-08-25 14:26:14 -07:00
Stephane Moore
fc2b5ac747 [objc] Fix the link to the new Objective-C style guide ⛓
The link can't be relative because the new style guide is served as markdown and the endpoint serving the XML file serves raw content.
2017-08-24 17:48:51 -07:00
Stephane Moore
0c88671aa8 Merge pull request #269 from google/update-objc
[objc] Update the Objective-C style guide 📜
2017-08-23 18:37:49 -07:00
Stephane Moore
82d0af2190 [objc] Update the Objective-C style guide 📜
Revision Date: 8/23/2017
2017-08-23 14:59:52 -07:00
Stephane Moore
d6bc013ece [objc] Make objcguide.xml link to objcguide.md 🔄
There are links out in the wild to the old XML style guide. An XML file that links to the new style guide location ensures that those links are not completely broken.
2017-08-23 14:57:27 -07:00
Mark Mentovai
de57acaedf Update link to Objective-C style guide 2017-08-22 18:16:59 -04:00
Mark Mentovai
0d23d722dc Merge pull request #267 from stephanemoore/update-objc
[objc] Update the Objective-C style guide 📜
2017-08-22 18:14:33 -04:00
Kevin Lindkvist
c5197bfc48 [objc] Update the Objective-C style guide 📜
Revision Date: 8/16/2017
2017-08-17 14:47:20 -07:00
Elliot Glaysher
62385582b8 Merge pull request #162 from ctubbsii/eclipse-formatter-on-off-tags
Enabling formatter on/off tags
2017-08-15 10:14:04 -07:00
Eric Anderson
77f7f28d31 Merge pull request #153 from alanyee/gh-pages
Update broken link
2017-08-07 14:14:44 -07:00
Alexander Artemenko
2fb66df7d3 Fixed "full hairy example" of formatting control string
Example produced wrong results:
```
CL-USER> (format nil "Items:~#[ none~; ~S~; ~S and ~S~:;~@{~#[~; and~] ~S~^ ,~}~]." :foo :bar :baz :kadabr)
"Items: :FOO , :BAR , :BAZ , and :KADABR."
```

With this fix, it uses commas correctly:

```
CL-USER> (format nil "Items: ~#[ none~; ~S~; ~S and ~S~:;~@{~S~^~#[~; and ~:;, ~]~}~]." :foo :bar :baz :kadabr)
"Items: :FOO, :BAR, :BAZ and :KADABR."
```
2017-07-30 21:28:02 +03:00
Elliot Glaysher
6c8669edb2 Fix test regression from 9883c51578. 2017-07-28 14:54:33 -07:00
Elliot Glaysher
0c1c7f193f Merge pull request #265 from hammacher/remove-disallow-presubmit-check
Remove presubmit check for DISALLOW_* macros
2017-07-26 10:59:27 -07:00
Clemens Hammacher
9883c51578 Remove presubmit check for DISALLOW_* macros
Before C++11, we were using a hack to disable copy constructors or copy
assignment by declaring the methods private and not implementing them.
This hack required the respective macros to be placed in the private:
declarations of a class.
The macros have switched to use the C++11 "= delete" syntax some time
ago in both v8 and chromium:
https://codereview.chromium.org/1123723003/
https://codereview.chromium.org/2017213002

Also the comments are now updated, since the macros do not need to be
in the private: declarations any more:
https://chromium-review.googlesource.com/c/577687
https://chromium-review.googlesource.com/c/578027

This change also removes the presubmit check that checked that the
macros are only used in the private declarations.
2017-07-24 12:57:05 +02:00
Elliot Glaysher
d75bd35c8f Merge pull request #261 from jrobinson2/gh-pages
Fixed a typo.
2017-06-29 23:25:26 -07:00
James Robinson II
6161e33d8a Fixed a typo. 2017-06-29 22:16:49 -04:00
Mark Mentovai
85799e8cd3 Merge pull request #257 from kwalrath/patch-1
Tweak URL for Go style guide
2017-06-22 17:03:13 -04:00
Kathy Walrath
2886a3f454 Tweak URL for Go style guide 2017-06-22 14:02:14 -07:00
Mark Mentovai
a11ef46100 Merge pull request #256 from kwalrath/patch-1
Add Dart style guide
2017-06-22 16:40:51 -04:00
Mark Mentovai
470a53f383 Reverse order of [dart] and [go] to match prose 2017-06-22 16:39:56 -04:00
Kathy Walrath
bb56ab5026 Change link to Go style guide 2017-06-22 12:30:50 -07:00
Kathy Walrath
8aab535ade Add Dart style guide
* Added Go while I was in there. (@rakyll or @adg might have feedback on the link I used)
* Rewrote things a bit to make the new links fit.
* Copy edited a bit because I couldn't help myself.
2017-06-22 11:26:59 -07:00
Elliot Glaysher
142b0e64ba Merge pull request #250 from kirkins/patch-1
Fix broken link
2017-05-26 13:14:04 -07:00
Philip Kirkbride
e3d0f56bcd Fix broken link
Same guide is also linked on line 1144, but uses correct url (.html)
2017-05-26 15:45:00 -04:00
Stephen Hicks
c212f99186 Update JS style guide 2017-05-08 16:24:00 -07:00
Elliot Glaysher
d012c72624 Merge pull request #244 from schoetbi/FixVs7Oput
Changed vs7 output format so that Visual Studio can parse the error
2017-05-03 10:15:59 -07:00
schoetbi
819c572b4c Changed vs7 output format so that Visual Studio can parse the error messages correctly
Also Visual Studio can jump to the correct file/linenumber
2017-05-03 10:11:03 +02:00
Elliot Glaysher
15f2836d9f Merge pull request #230 from danakj/gh-pages
Teach the explicit constructor check about constexpr.
2017-03-02 10:23:49 -08:00
Dana Jansens
2db65fed51 Add unit tests for constexpr constructors
This also adds unit tests for inline+explicit constructors being okay,
with and without constexpr.
2017-03-02 13:20:12 -05:00
Liam Miller-Cushon
594d91bfbb Update Java style guide 2017-02-28 21:12:14 -08:00
Tony Ruscoe
9fe17f92b7 Merge pull request #235 from tonyruscoe/html-css-style-validation
Fix HTML validation warnings and make the style guide HTML more compliant.
2017-02-27 09:33:22 +00:00
Tony Ruscoe
ad6dee81e9 Fix HTML validation warnings and make the style guide HTML more compliant. 2017-02-27 08:16:24 +00:00
Tony Ruscoe
b726be1588 Merge pull request #233 from tonyruscoe/gh-pages-anchor-and-emphasis
Add an anchor for the “Parting Words” section and change the emphasis on “Be consistent.”
2017-02-24 14:43:16 +00:00
Tony Ruscoe
a1773f9b3b Add an anchor for the “Parting Words” section and change the emphasis on “Be consistent.” 2017-02-24 14:38:42 +00:00