Commit Graph
60 Commits
Author SHA1 Message Date
Mikhail 69ff75ddfa Check formatting of all files in presubmit --all (#33854)
The PR adds formatting check for all files in no-platform builds.
This help to prevernt the situations "formatting rules are changed, but the current files don't fit".
2026-02-11 18:27:45 +04:00
Mikhail 3a8b0e3288 Fix eslint config (#33746)
The PR:
* Reengineering eslint.config.js to properly extending the existing plugins and configs.
   It also implies disabling a bunch of broken rules.
* Adds running eslint for all brave files in `npm run presubmit -- --all`.
* Also enables eslint check for all *.js files
2026-02-11 13:37:02 +04:00
Jay Harris 3d73b11d6b [deps]: Upgrade eslint to supported non-vulnerable version (#33554)
* Bump ESLint packages

* Auto fixes

* Remove deleted rules

* Fix presubmit

* Formatting

* Begin migrating to typescript-eslint

* Lint eslint config

* Fix CI failures from missing packages
2026-02-04 19:20:45 +00:00
Brian Johnson bff8ee509f Reland - Move replacement files for chromium resources to their own directory (#33204)
This moves files that are directly copied over chromium resources to a separate directory where they are checked to make sure that there is a corresponding upstream file. This is the first step in a series of changes to clean up branding.js https://github.com/brave/brave-browser/issues/51969
2026-01-14 19:44:13 +00:00
Brian Johnson 54166dfe58 Revert "Move files that overwrite chromium resources to their own directory" (#33203)
Revert "Move files that are copied to chromium to their own directory (#33159)"

This reverts commit 9324eec2d3.
2026-01-14 13:56:06 +00:00
Brian Johnson 9324eec2d3 Move files that are copied to chromium to their own directory (#33159)
Separate files that overwrite chromium resources from brave specific resources and validate that there is a corresponding file in upstream.
2026-01-14 05:18:58 -07:00
Brian R. Bondy 71c0ca7899 Brave Origin theme assets (#32873)
* Brave Origin theme assets

The optimization used optipng -o7 which is 100% lossless

* Fix PRESUBMIT.py check for brave_origin theme

* Fix PRESUBMIT.py lint
2025-12-19 15:26:28 -05:00
Shivan e802a435f3 Presubmit ban rule for OSCrypt Sync usage (#32679) 2025-12-04 20:33:26 +01:00
Michael Herrmann f04aac11c8 Fix incorrect presubmit error (#32453) 2025-11-21 06:47:44 +01:00
Aleksei Khoroshilov d6747425fc Fix presubmit format check --base flag passing. (#32167) 2025-11-01 08:26:53 +00:00
Aleksei Khoroshilov 6197d975b8 Ban base::debug::DumpWithoutCrashing to prevent test hangs (#31981)
Prevent DumpWithoutCrashing direct use.
2025-10-23 17:56:16 +07:00
Max Karolinskiy 5ceebbae2d [cr141][Linux] Update product logo icons for installer.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/8c28f057f084a5c5ed3993df7d620ccadc3bf003

commit 8c28f057f084a5c5ed3993df7d620ccadc3bf003
Author: Tom Anderson <thomasanderson@chromium.org>
Date:   Thu Aug 14 11:58:44 2025 -0700

    Remove debian.menu from Debian packages

    The debian.menu files have been replaced with .desktop files in all
    major desktop environments. This CL removes it, and the old XPM icon
    resources, which were only used by debian.menu. Finally, fix a bit of
    nondeterminism exposed by bug 377894390 by sorting the icon list.

    R=thestig

    Change-Id: Ia36754d05865e327da0c97b715434a1180ead0c5
    Bug: 377894390
2025-09-22 15:02:16 -04:00
Jay Harris 2b77f9c431 [Presubmit]: Fix TODO regex (#30795) 2025-08-26 09:03:23 +12:00
Emerick Rogul 793e3fb89d [cr140] Handle Assets.car file on Mac
Add new Assets.car files on Mac, which contain the same assets from app.icns.
This required a small change to our PRESUBMIT check for upstream theme file
overrides, as it wasn't accounting for channel-specific assets.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/47dc8a5451bf0e73c0c903d53110aeb52bc1865f

commit 47dc8a5451bf0e73c0c903d53110aeb52bc1865f
Author: Avi Drissman <avi@chromium.org>
Date:   Tue Jul 8 13:08:17 2025 -0700

    Handle .car files in BUILD.gn

    1. Copy the .car file into the Resources folder alongside the app.icns
       file.
    2. Copy the channel .car files into the packaging zip file so that the
       packaging scripts can have access to them.

    Bug: 425894794
    Change-Id: I56f6a701c16ab37c921a4bd1b4ba33718f61072a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6701055
    Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
    Reviewed-by: Mark Mentovai <mark@chromium.org>
    Commit-Queue: Avi Drissman <avi@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1483954}
2025-08-19 19:54:23 +01:00
cdesouza-chromium 468ce215b7 [CodeHealth] IWYU for absl::StrFormat (#30441)
This PR runs a mechanical change to do IWYU on all files using the new
abseil functions, while also removing the old header inclusions for
`base::StringPrintf`.

A presubmit `BanRule` is also being added for the `base::` functions.

Resolves https://github.com/brave/brave-browser/issues/48143
2025-08-05 18:20:12 +01:00
Kyle Hickinson 4226628cf2 Remove explicit lint filters passed in when running cpplint in presubmit (#30372)
This allows cpplint to be run with the default `OFF_BY_DEFAULT_LINT_FILTERS` filter list which fixes a number of false positives in Obj-C files such as `readability/casting`
2025-07-30 16:36:18 -04:00
Brian Johnson c3a6cb3dca Restrict new brave/app/theme files to overrides for upstream (#29974) 2025-07-14 10:58:39 -07:00
Aleksei Khoroshilov f9defae33c Print node error correctly on launch via presubmit. (#29987) 2025-07-14 14:08:53 +07:00
cdesouza-chromium 28d89d8540 [CodeHealth] PRESUBMIT check for nogncheck (#29839)
This PR adds a presubmit check for `nogncheck` uses, to make sure we are
using this lint suppresion label in places where appropriate. In
particular, the need for this check has come up due to the wrong
assumption that `gn` somehow lacked the ability to understand `#ifdef`
conditionals for header inclusions, when in fact, the issue with `gn`
checks in such cases is that there is a buildflag for a certain
exclusion, but the same exclusion has also to be applied in gn files.

Resolves https://github.com/brave/brave-browser/issues/47269
2025-06-30 15:43:35 +01:00
cdesouza-chromium 513728119a [plaster] Adding presubmit check for 🩹 files (#29730)
[plaster] Adding presubmit check or 🩹 files

This PR is a follow up on
https://github.com/brave/brave-core/pull/29716.

This PR adds a presubmit check that calls `plaster.py check`, and
validates to make sure that any submitted plaster file is up-to-date
with its patches, and applying correctly to the Chromium tree.

There's still some work to be done regarding deleted plaster files, and
what to do with a present patch file in such a case, but this is being
tracked in a separate ticket.

Resolves https://github.com/brave/brave-browser/issues/45058
2025-06-25 11:57:14 +01:00
MikhailandAleksei Khoroshilov 005903ac06 Support prettier for build/ (#28898)
* add prettier to format, call format from PRESUBMIT
* make format.js
* update prettier
* Add unformatted dirs to .prettierignore
* Fix linter errors
* cleanup .prettierignore
* Convert format.js to a script
* review fixes
* add some prettier-ignore-*
* Address some review issues
* move commander declaration
* Add --presubmit and --dry-run for format
* Revert "add some prettier-ignore-*"
* Fix eslint, add printWidth exclusion
* Remove printWidth override
* Fix eslint and format warn
* use bracketSameLine
* Review fixes
* use a single git cl format call
* Use spawnSync to avoid log flooding
* More review fixes
* More review updates
* Update build/commands/scripts/format.js
Co-authored-by: Aleksei Khoroshilov <5928869+goodov@users.noreply.github.com>

* Renames some vars
* Use absolute path for format.js
---------
Co-authored-by: Aleksei Khoroshilov <5928869+goodov@users.noreply.github.com>
2025-05-19 13:56:11 +04:00
Brian Johnson d9ae60df7b add presubmit checks for banned JS and Profile functions (#29046) 2025-05-16 00:58:21 +02:00
Aleksei Khoroshilov 4bc5f98325 Fix xml license check (#28575)
* Fix xml license header check.

* Format.

* Update some license headers to match the required format.
2025-04-10 12:34:45 +07:00
cdesouza-chromium d5137addd8 [CodeHealth] Fix the PRESUBMIT TODO warning (#28388)
Source code TODO warnings are being validated based on an upstream
expectation that doesn't match with our own bug tracking in Github. This
PR lifts the upstream check but changes the check to accommodate it to
our needs.

Resolves https://github.com/brave/brave-browser/issues/45054
2025-04-01 10:24:43 +01:00
Claudio DeSouza ca36a941d8 [cr133] Remove NOTREACHED_IN_MIGRATION presubmit checks
This macro has been deleted in chromium so there's no need to check for
it anymore.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/e238462dc67196d361ee0bbaf1954969619cab27

commit e238462dc67196d361ee0bbaf1954969619cab27
Author: Peter Boström <pbos@chromium.org>
Date:   Fri Nov 15 00:46:51 2024 +0000

    Remove NOTREACHED_IN_MIGRATION()

    Bug: 40580068
2025-01-27 09:36:28 -05:00
Aleksei Khoroshilov e3be8f4d9d Add minimal presubmit patch check (#26807)
* Update presubmits a bit.

* Prevent unnecessary empty lines modification in patches.
2024-12-03 10:56:56 +07:00
cdesouza-chromium 3b462c7f0a [CodeHealth] Disallow new NOTREACHED_IN_MIGRATION uses (#26297)
[CodeHealth] Disallow new `NOTREACHED_IN_MIGRATION` instances

This PR adds a new presubmit check to prevent the introduction of new
occurrences for `NOTREACHED_IN_MIGRATION`. This macro is supposed to be
on its way out, however there are still new occurrances being introduced
in recent times.
2024-10-30 04:07:12 +00:00
goodov b1dc9a2733 Disable few pylint checks. (#25065)
Update pylint rules.
2024-08-13 18:32:30 +07:00
goodov f14614852c Cleanup EnableStackLogging() call. (#24914) 2024-07-30 12:32:12 +01:00
goodov 2e03fc5a96 Show diff on presubmit format check failure (#22491)
* Show diffs when presubmit format check fails.

* Sync `npm run format` and `presubmit` format check.

* Add --diff flag support to `npm run format`.
2024-03-12 01:08:07 +07:00
Kyle Hickinson 8cd62ad5e0 [iOS] Download up-to-date swift-format and enable swift formatting
Also updates a few swift formatting rules based on iOS team feedback
2024-02-27 09:53:05 -05:00
Kyle Hickinson 8ae6c72f59 Revert "[iOS] Enable swift-format in presubmit/format commands"
This reverts commit 89209bf2ad.
2024-02-16 18:32:20 -05:00
Kyle Hickinson 89209bf2ad [iOS] Enable swift-format in presubmit/format commands 2024-02-15 12:33:05 -05:00
Kyle HickinsonandMihai PLESA c8f8ba0e47 Migrate brave-ios into brave-core (#21553)
* update build script, move core package directory

* Use xcode scheme pre-actions

* Make args file with version & api keys, remove unused configs

* Update dev to nightly naming, cleanup, fix missed test

* Remove brave-core-ios from package, update bootstrap

* dont remove frameworks early

* Move brave-ios npm packages into brave-core, cleanup

* Disable swift-format for now, disable clang-format on ThirdParty dir

* Build frameworks to src/out directory instead of inside brave-ios folder

* Move ios third party deps to brave/third_party/ios_deps directory

* Fix bootstrap copy with new directories, more cleanup

* Add iOS unit tests to `npm run test` command

* Remove swift formatting from presubmit

* Use symlink to output directory, move xcframework creation to npm cmd

* Add license checker special cases for iOS deps

* Presubmit fixes

* Replace `build_in_core` shell script with `scheme_preaction` python

- Adds `brave_ios_marketing_version` config and adds pre-actions for all main schemes
- Re-add Nightly (Dev) scheme

* Cleanup bootstrap, complete dev to nightly rename, remove Local xcconfigs

Plus format/presubmit fixes

* Remove SPM Package.resolved and ignore it

We won't be using the non-Xcode project based build system

* Update presubmit config, Remove macOS wireguard framework prebuild

* Add license info for moved brave-ios npm packages

* Exclude third_party/ios_deps from cpplint

* Add DEPS file to Guardian dep

* Rename brave_version_patch to illustrate its for iOS only

* Use correct GN configuration based on Xcode configuration

* Allow ios bootstrap script to be run from any directory. Update README

* Make fastlane channel builds also release to testers

Also fixes an issue where Xcode injected environment variables were available during GN builds which would cause build failures in Release configurations

* Remove clean git status check from fastlane

* Update fastlane script to always run bootstrap

* Fix bootstrap script copying placeholders to the wrong directory

* Disable xcpretty in fastlane scripts

* Fix debug scheme entitlements now that it shares nightly bundle id

* Update simulator target in fastlane unit test lane

* Disable xcpretty on unit tests and fixup test build

* Add provisioning profiles for nightly builds

* Expand relative directories in bootstrap

* Add explicit provisioning for nightly

* Fix tests & export junit reports

* Update nightly provisioning profile names

* Remove all skipped tests

* Fix failing unit tests

* Add explicit provisioning profiles for beta & release

* Remove app center fastlane plugin and ignore fastlane test_output in git

* Cleanup Xcode project config

* Fix invalid code signing identities on individual targets

* Skip flaky wallet tests, re-add automatic signing for debug builds

* Fix flaky CoreData tests by guaranteeing view context merge

* Update Jenkinsfile

* Move Xcode derived data directory to src/out for CI builds

* Remove 'No Changes' CoreData test

* Fixed missed Xcode derived data directory setting for iPad test build

* Fix iPad test plan

* Separate testflight build & upload into multiple fastlane runs

* Add version string to MaterialComponents during preaction

* Add ability to pass in PUBLIC CI arg into fastlane upload lane

* Cleanup config & presubmit rules

* Add explicit licenses/README.chromium's for third party iOS deps

* Presubmit cleanup/fixes

* Change Xcode preactions to run on xcframeworks instead of GN outputs

This avoids rebuilds that are due to BraveCore.framework and MaterialComponents.framework folders being touched in the out directory when we cleanup chromium assets and fix the MaterialComponents Info.plist

* Improve debugging when `strip_absolute_paths_from_debug_symbols` is true

- The bootstrap script now generates an LLDBInit that is used for Debug schemes. This file contains an lldb target.source-map to allow lldb to resolve breakpoints
- SPM & Xcode now build with the `-debug-prefix-map` swift flag so that all iOS files built out of GN also have relative debug paths
- Replace compilation flags being defined with OTHER_SWIFT_FLAGS to use SWIFT_ACTIVE_COMPILATION_CONDITIONS instead

* Remove SPM reload during preaction and use .env for Package.swift

This removes a race that could happen when reloading the package during the build

* Add Action Extension provisioning profiles and fix its xcode build settings

* Move xcframework creation command into separate file

* Fixup nvm/brew npm PATHs in Xcode pre-action script

* Move iOS bootstrap into gclient runhook, rename current_link

* Bootstrap script improvements based on feedback

* Rebase master/fix bootstrap import

* Bootstrap script improvements based on feedback pt2

* Revert Jenkinsfile change

* Move CheckNoJsInIos and CheckNoDeprecatedCss into permanent ignores

* Rebase master & fix wallet mock asset ratio service

---------

Co-authored-by: Mihai PLESA <mplesa@brave.com>
2024-02-12 13:26:42 -05:00
Jocelyn Liu 58c8b5134a Add presubmit check for new .cc/.h/.mm source files without corresponding GN changes 2024-02-06 15:07:48 -08:00
Aleksey Khoroshilov 9973dbac85 Refactor import_inline into brave_chromium_utils (#21482)
* Rename import_inline -> brave_chromium_utils.

* Add inline_chromium_src_override helper.

* Remove inline_file_from_src.

* Add typing info into brave_chromium_utils.

* Format and fix sys_path usage.

* Scan all overridable files in check_chromium_src.py.

* Replace another occurence of the hardcoded path in the error message.

* Move get_gn_arg to brave_chromium_utils.

* Update patches after cr121 rebase.
2024-02-06 20:40:25 +07:00
Aleksey Khoroshilov a896d5474c Remove .pylintrc in favor of Chromium pylintrc. 2023-12-28 14:48:41 +07:00
Aleksey Khoroshilov 6c86a03f92 Fix presubmit format check and always use UTF-8 in Python on Windows. 2023-12-21 14:00:44 +07:00
Aleksey Khoroshilov 9d947d6f7b Introduce wspath and fix inline_file stacktraces to show filepath. 2023-12-19 18:04:36 +07:00
Shivan Kaul Sahib a215b6f827 Add presubmit warning check for base::PathService::Get (#21009)
* Add presubmit check for base::PathService::Get
* error => warning
2023-11-16 13:18:19 -08:00
Aleksey Khoroshilov cec81370aa Support redirect_cc as rewrapper. 2023-11-01 13:53:03 +07:00
Claudio DeSouza dddc1dd6a0 Add presubmit to prevent new StringPiece uses
This change adds a presubmit check to brave, to make sure we don't ended
reintroducing `base::StringPiece` until it gets finally deleted
upstream.
2023-09-22 17:46:21 +03:00
Jay Harris 0f73ab4331 [Leo] Version Bump & Integrate Presubmit (#19187) 2023-07-25 13:01:18 +02:00
zenparsing 2f852e3c6d Replace ledger terminology in Rewards code 2023-07-11 14:47:11 -04:00
bridiver b1c1343cd0 convert brave rust targets to upstream rust targets 2023-06-29 12:10:14 -07:00
AlexeyBarabash 16169dfe09 Make upstream's remove_unused_imports.py to be usable at Brave repo (#18903)
This PR introduces remove_unused_imports.sh script which wraps the same
upstream's tool and makes it usable at Brave repo.

Fixes brave/brave-browser#31045
2023-06-16 12:05:56 +03:00
AlexeyBarabash 6523c3bace Enable CheckJavaStyle presubmit check (#18761)
* Enable CheckJavaStyle presubmit check

For now severity for all checks except RedundantImport/UnusedImports
is changed from error to warning with brave-style-5.0.xml.

Once all Java style errors will be fixed, check should be switched
back to upstream's original check.

Fixes brave/brave-browser#30823

* Remove all unused/redundant imports from java files
2023-06-07 20:44:28 +03:00
Szilard Szaloki 31ca383797 Rewards architectural improvements. 2023-04-11 07:40:54 -05:00
Aleksey Khoroshilov f1f9c20cd3 Use BanRule.excluded_paths filter for CheckNoBannedFunctions check. 2023-03-23 20:38:15 +07:00
Aleksey Khoroshilov 32b1b9fabf Fail on missing presubmit overrides. 2023-03-23 20:27:51 +07:00