Граф коммитов

62 Коммитов

Автор SHA1 Сообщение Дата
Sylvestre Ledru 7baa783763 Bug 1857550 - clang-tidy: add test for readability-redundant-member-init r=linter-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D190396
2023-10-08 08:52:27 +00:00
Andi-Bogdan Postelnicu 72276f379c Bug 1855848 - fix infra bust for static-analysis autotest. r=sylvestre DONTBUILD
This is because the std is not located in the default location where the compiler
searches.
This is normal, but for autotest we don't generate a compile commands through the build
system, we generate a dummy one, with dummy paths so we need to transplant definitions
from std to the test files.

Differential Revision: https://phabricator.services.mozilla.com/D189619
2023-09-29 22:01:46 +00:00
Sylvestre Ledru 1ee8840016 Bug 1855672 - Enable some new clang-tidy checkers r=andi DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D189486
2023-09-28 16:03:55 +00:00
Andi-Bogdan Postelnicu b7b3a15bfc Bug 1855169 - static-analysis autotest fix. r=marco
Fixed fallout from migration to clang-17 where clang-tidy checker
bugprone-swapped-arguments has its message changed a bit.

Differential Revision: https://phabricator.services.mozilla.com/D189211
2023-09-26 10:32:13 +00:00
Andi-Bogdan Postelnicu 76e3e1586f Bug 1836676 - for clang-tidy activate mis-include-cleaner. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D179892
2023-06-06 09:46:49 +00:00
Mark Banner c2dd8e3266 Bug 1829618 - Enable Prettier on json files (automatic fixes). r=perftest-reviewers,webcompat-reviewers,extension-reviewers,andi,desktop-theme-reviewers,pip-reviewers,devtools-reviewers,sync-reviewers,mossop,denschub,dao,sparky,robwu,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D176336
2023-05-09 16:14:51 +00:00
Andi-Bogdan Postelnicu d29149bfd0 Bug 1815703 - [clang-tidy] Add checker clang-analyzer-optin.performance.Padding r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D169202
2023-02-13 15:17:37 +00:00
Andi-Bogdan Postelnicu 0d12e234b2 Bug 1731582 - Move to clang-13 r=firefox-build-system-reviewers,mhentges,decoder
Join work with glandium.

Differential Revision: https://phabricator.services.mozilla.com/D126208
2021-10-20 12:03:20 +00:00
Jeff Gilbert 85bbcbfa5e Bug 1602143 - Use ShortStatementLines=1 for readability-braces-around-statements. r=andi
This will reduce the false-positive rate that sometimes causes devs to
ignore other important warnings because they expect to see these
warnings because of module/legacy code styles.

```
if (foo) return; // no longer warns
if (bar)
  return; // still warns
```
clang-format will sometimes turn long-line versions of the former into
the latter, and this warning will pick those as readability warnings.
NB: This is Chromium style for same-line conditional statements.

Another test result json has its EOL-newline removed too, since that's
what the script does and I'm just committing its results.

Differential Revision: https://phabricator.services.mozilla.com/D105497
2021-02-18 08:26:11 +00:00
Kartik Gautam 7ae6aea145 Bug 1684173 - Add newline character at end of files when missing r=sylvestre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D100484
2021-01-07 08:53:08 +00:00
Cosmin Sabou 2978aa00a3 Backed out changeset dbed1cdf588f (bug 1684173) for mochitest plain and devtools failures. a=backout DONTBUILD 2020-12-28 00:43:51 +02:00
Kartik Gautam 775cdec032 Bug 1684173 - Add newline character at end of files when missing r=sylvestre
Depends on D100443

Differential Revision: https://phabricator.services.mozilla.com/D100484
2020-12-27 11:43:41 +00:00
Kartik Gautam f7ffcd09fb Bug 1679758 - Remove trailing empty lines r=sylvestre,marionette-reviewers,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D99595
2020-12-15 10:34:54 +00:00
Dorel Luca 7320ae982a Backed out changeset f3aaf04fce3b (bug 1679758) for Devtool failures in browser_styleeditor_syncAddProperty.js. CLOSED TREE 2020-12-13 16:38:21 +02:00
Kartik Gautam caf549c200 Bug 1679758 - Remove trailing empty lines r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D99595
2020-12-13 13:28:30 +00:00
Andi-Bogdan Postelnicu 8731a55350 Bug 1612274 - Add checker `readability-qualified-auto` for `clang-tidy` static-analysis. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D70481

--HG--
extra : moz-landing-system : lando
2020-04-10 07:06:09 +00:00
Andi-Bogdan Postelnicu 56a9802f89 Bug 1625884 - move `clang-tidy` and `clang-format` to `clang-10`. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D70065

--HG--
extra : moz-landing-system : lando
2020-04-09 14:16:44 +00:00
Cosmin Sabou 60934f9072 Backed out 3 changesets (bug 1625884) as requested by ANdi for causing build bustages. a=backout
Backed out changeset a35cfda6e271 (bug 1625884)
Backed out changeset 412c8c401196 (bug 1625884)
Backed out changeset 927ff250bc4b (bug 1625884)
2020-04-09 16:14:06 +03:00
Andi-Bogdan Postelnicu ffe0a6a754 Bug 1625884 - move `clang-tidy` and `clang-format` to `clang-10`. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D70065

--HG--
extra : moz-landing-system : lando
2020-04-09 05:28:34 +00:00
Sylvestre Ledru 205bea23c3 Bug 1617528 - Enable modernize-use-using at review phase r=andi
Differential Revision: https://phabricator.services.mozilla.com/D63819

--HG--
extra : moz-landing-system : lando
2020-02-24 10:05:16 +00:00
Andi-Bogdan Postelnicu 43270f5c15 Bug 1606630 - add tests with `if constexpr` for checkers `readability-misleading-indentation` and `readability-braces-around-statements`. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D58936

--HG--
extra : moz-landing-system : lando
2020-01-08 08:39:44 +00:00
Sylvestre Ledru 3ff277ca7c Bug 1605852 - Enable modernize-concat-nested-namespaces r=andi
Depends on D58190

Differential Revision: https://phabricator.services.mozilla.com/D58191

--HG--
extra : moz-landing-system : lando
2019-12-26 10:22:23 +00:00
Jeff Gilbert 1e61298151 Bug 1601103 - Enable clang-tidy's cppcoreguidelines-pro-type-member-init. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D55745

--HG--
extra : moz-landing-system : lando
2019-12-04 19:57:08 +00:00
Andi-Bogdan Postelnicu c85e350b5b Bug 1599101 - For clang-tidy based analysis add checker `clang-analyzer-cplusplus.Move`. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D54522

--HG--
extra : moz-landing-system : lando
2019-11-25 15:54:58 +00:00
Andi-Bogdan Postelnicu a907930749 Bug 1558359 - clang-tidy - For `performance-move-const-arg` disable detection of trivially copyable types that do not have a move constructor. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D49415

--HG--
extra : moz-landing-system : lando
2019-10-16 12:59:33 +00:00
David Major 103a1cbba6 Bug 1573211 - Update to clang 9.0.0 r=glandium
Updates all clang 8.0.1 to version 9.0.0, except for the mingw builds
which suffer from bug 1548624 and will be handled separately later.

Differential Revision: https://phabricator.services.mozilla.com/D44160

MANUAL PUSH: Rebuild clang toolchains without stalling autoland

--HG--
rename : build/build-clang/clang-8-android.json => build/build-clang/clang-android.json
rename : build/build-clang/clang-8-linux64-aarch64-cross.json => build/build-clang/clang-linux64-aarch64-cross.json
rename : build/build-clang/clang-8-linux64.json => build/build-clang/clang-linux64.json
rename : build/build-clang/clang-8-macosx64.json => build/build-clang/clang-macosx64.json
rename : taskcluster/scripts/misc/build-clang-8-linux-macosx-cross.sh => taskcluster/scripts/misc/build-clang-linux-macosx-cross.sh
2019-09-21 16:26:53 +02:00
Brindusan Cristian e2348a18ee Backed out 2 changesets (bug 1573211) as requested by dmajor on irc. CLOSED TREE
Backed out changeset 587463567434 (bug 1573211)
Backed out changeset de0fe40466cb (bug 1573211)

--HG--
rename : build/build-clang/clang-android.json => build/build-clang/clang-8-android.json
rename : build/build-clang/clang-linux64-aarch64-cross.json => build/build-clang/clang-8-linux64-aarch64-cross.json
rename : build/build-clang/clang-linux64.json => build/build-clang/clang-8-linux64.json
rename : build/build-clang/clang-macosx64.json => build/build-clang/clang-8-macosx64.json
rename : taskcluster/scripts/misc/build-clang-linux-macosx-cross.sh => taskcluster/scripts/misc/build-clang-8-linux-macosx-cross.sh
extra : histedit_source : 3f9570ab67fd42186265b1dbb6e93c8342bc60e2
2019-09-26 20:12:51 +03:00
Andi-Bogdan Postelnicu 5f02cc9b02 MANUAL PUSH: Fix for Bug 1573211 - Re-generate the autotest results for clang-tidy analysis. r=myself.
--HG--
extra : rebase_source : d360e92b0da5701e1cfd4e1f49032283bd288ed5
extra : amend_source : edf7899f8bce61f4a5120713bd04cedc83085ea7
2019-09-25 17:30:19 +03:00
Andi-Bogdan Postelnicu ca4a195007 Bug 1551842 - Add new clang-tidy checkers from clang 8.0.0. r=sylvestre,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31229

--HG--
extra : moz-landing-system : lando
2019-05-22 14:55:45 +00:00
Andi-Bogdan Postelnicu 7be18f3d26 Bug 1503453 - re-enable static-analysis autotest on win64 platform after migrating to clang-tidy 8. r=sylvestre
Also for checker `modernize-avoid-bind` export the respective reliability index from config.yaml

Differential Revision: https://phabricator.services.mozilla.com/D30904

--HG--
extra : moz-landing-system : lando
2019-05-14 13:00:13 +00:00
Sylvestre Ledru 88e7b97c2a Bug 1551083 - Enable bugprone-move-forwarding-reference r=andi
Differential Revision: https://phabricator.services.mozilla.com/D30816

--HG--
extra : moz-landing-system : lando
2019-05-14 07:12:37 +00:00
Andi-Bogdan Postelnicu 32fe00ed34 Bug 1544764 - Add description at review phase about defects found - clang-tidy. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D27669

--HG--
extra : moz-landing-system : lando
2019-04-18 08:49:52 +00:00
Csoregi Natalia feb0789249 Backed out changeset 7cefdbb63711 (bug 1544764) for static-analysis bustage on clang-analyzer-deadcode.DeadStores.cpp. CLOSED TREE 2019-04-18 00:33:29 +03:00
Andi-Bogdan Postelnicu bbedccc1b9 Bug 1544764 - Add description at review phase about defects found - clang-tidy. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D27669

--HG--
extra : moz-landing-system : lando
2019-04-17 16:16:42 +00:00
Andi-Bogdan Postelnicu fb86931b20 Bug 1503453 - Fix Perma 'mach static-analysis autotest; caused by Bug 1540769. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D26095

--HG--
extra : moz-landing-system : lando
2019-04-04 11:34:47 +00:00
Andi-Bogdan Postelnicu 2139aad55e Bug 1479298 - [Static-Analysis][Clang-Based] Implement the passing of configuration flags to checkers in the configuration file. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D7997

--HG--
extra : moz-landing-system : lando
2018-10-10 08:01:24 +00:00
Sylvestre Ledru fb80392dd8 Bug 1253844 - Enable the readability-implicit-bool-conversion checker r=andi
Differential Revision: https://phabricator.services.mozilla.com/D7606

--HG--
extra : moz-landing-system : lando
2018-10-03 16:30:29 +00:00
Andi-Bogdan Postelnicu b22a8a3837 Bug 1494951 - [Static-Analysis][Clang-Tidy] Publish checker 'readability-redundant-smartptr-get'. r=janx
Differential Revision: https://phabricator.services.mozilla.com/D7169

--HG--
extra : moz-landing-system : lando
2018-10-01 12:52:39 +00:00
Andi-Bogdan Postelnicu bc36108b34 Bug 1487321 - [Static-Analysis][Clang-Tidy] Add new checkers present in 7.0. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D7045

--HG--
extra : moz-landing-system : lando
2018-10-02 14:10:32 +00:00
Andi-Bogdan Postelnicu fb4dc15757 Bug 1480089 - pass all of the test files to to our static-analysis pipeline. r=janx
Differential Revision: https://phabricator.services.mozilla.com/D4659

--HG--
extra : moz-landing-system : lando
2018-09-20 07:38:27 +00:00
Sylvestre Ledru e148db5ea3 Bug 1488687 - Enable braces around statements clang-tidy checker r=Ehsan
This will be enabled only at review phase.
If the warning is ignored in phabricator, nothing will happen.

This should be enforced as it is part of the Mozilla coding style:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Control_Structures

Differential Revision: https://phabricator.services.mozilla.com/D5014

--HG--
extra : moz-landing-system : lando
2018-09-05 14:07:58 +00:00
Jan Keromnes 11dd9afb58 Bug 1486410 - Bug 1466427 - Enable new clang-tidy 7.0 checks. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D4210

--HG--
extra : moz-landing-system : lando
2018-09-04 11:55:19 +00:00
Margareta Eliza Balazs 294c48bb26 Backed out changeset f9d93a20e6d6 (bug 1486410) for Sa failures error: clang-tidy auto-test failed for checker performance-inefficient-algorithm CLOSED TREE
--HG--
extra : rebase_source : b7234db6fde4e4ec59933e20f10820f5a8fc82ec
2018-08-28 18:28:41 +03:00
Jan Keromnes 595e7789c3 Bug 1486410 - Bug 1466427 - Enable new clang-tidy 7.0 checks. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D4210

--HG--
extra : moz-landing-system : lando
2018-08-27 17:56:03 +00:00
Andi-Bogdan Postelnicu 34a6c4ff8f Bug 1466427 - Migrate clang-tidy package from 5.0.1 to 7.0.0-rc2. r=glandium,janx
Differential Revision: https://phabricator.services.mozilla.com/D3980

--HG--
rename : tools/clang-tidy/test/misc-bool-pointer-implicit-conversion.cpp => tools/clang-tidy/test/bugprone-bool-pointer-implicit-conversion.cpp
rename : tools/clang-tidy/test/misc-forward-declaration-namespace.cpp => tools/clang-tidy/test/bugprone-forward-declaration-namespace.cpp
rename : tools/clang-tidy/test/misc-macro-repeated-side-effects.cpp => tools/clang-tidy/test/bugprone-macro-repeated-side-effects.cpp
rename : tools/clang-tidy/test/misc-string-constructor.cpp => tools/clang-tidy/test/bugprone-string-constructor.cpp
rename : tools/clang-tidy/test/misc-string-integer-assignment.cpp => tools/clang-tidy/test/bugprone-string-integer-assignment.cpp
rename : tools/clang-tidy/test/misc-suspicious-missing-comma.cpp => tools/clang-tidy/test/bugprone-suspicious-missing-comma.cpp
rename : tools/clang-tidy/test/misc-swapped-arguments.cpp => tools/clang-tidy/test/bugprone-swapped-arguments.cpp
rename : tools/clang-tidy/test/misc-unused-raii.cpp => tools/clang-tidy/test/bugprone-unused-raii.cpp
extra : moz-landing-system : lando
2018-08-24 12:39:58 +00:00
Andi-Bogdan Postelnicu 2132bcd260 Bug 1476762 - Declare strcat, strlen and size_t to use appropriate types in declaration, definition. r=janx
MozReview-Commit-ID: 7JuATmROVVr

--HG--
extra : rebase_source : f798a188a521b76a5ed15913d24733324602820e
2018-07-18 22:59:10 +03:00
Chris Peterson 05d177e56a Bug 1475882 - clang-tidy: Enable misc-string-integer-assignment check. r=andi
The check finds assignments of an integer to std::string:

https://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-integer-assignment.html

There are currently ten misc-string-integer-assignment warnings in mozilla-central, but they are all in third-party Breakpad code:

toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:306:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:307:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:309:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:310:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:311:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:313:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:314:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:315:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:316:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility

MozReview-Commit-ID: AUOyOuCzy1R

--HG--
extra : source : 93356b5c58539d19c27dade7b1514bae709bc149
extra : histedit_source : 4bc38ab5a7a50869aaf4fce87aa2f75ce9dd301a
2018-07-14 23:48:40 -07:00
Chris Peterson 126761ba3c Bug 1475882 - clang-tidy: Enable misc-string-constructor check. r=andi
Finds string constructors that are suspicious and probably errors. There are currently no misc-string-constructor warnings in mozilla-central!

https://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-constructor.html

MozReview-Commit-ID: LyJt6wqOhg9

--HG--
extra : source : 0b36b6b1b7931adec5846086a52080edb3ec5e7d
extra : histedit_source : 30249980b219d4813fc5503c87e84265ad354e2f
2018-07-14 23:41:55 -07:00
Chris Peterson 59cd83d07a Bug 1475882 - clang-tidy: Enable bugprone-suspicious-memset-usage check. r=andi
This check finds memset() calls with potential mistakes in their arguments. There are currently no bugprone-suspicious-memset-usage warnings in mozilla-central!

https://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-memset-usage.html

MozReview-Commit-ID: 9gmtidgMPwW

--HG--
extra : source : 9c6f6e1553c45751f476c2d8418b9d4735e27e50
extra : histedit_source : 721536e24babf3734e116bd6beaf8d43722cca96
2018-07-08 23:54:13 -07:00
Chris Peterson 9574957168 Bug 1475882 - clang-analyzer: Enable clang-analyzer-unix.Malloc check. r=andi
Check for memory leaks, double free, and use-after-free and offset problems involving malloc. There are currently no clang-analyzer-unix.Malloc warnings in mozilla-central!

https://clang-analyzer.llvm.org/available_checks.html

MozReview-Commit-ID: G32SlokD64O

--HG--
extra : source : a2c8ccd2da1968b64510569f12f4631c54fea2d8
extra : histedit_source : b42c3ce2c3f8132fc0b301e6309b5ad25192167c
2018-07-14 23:28:26 -07:00