diff --git a/.clang-format-ignore b/.clang-format-ignore index 8d232f8c190..5f3620f21d5 100644 --- a/.clang-format-ignore +++ b/.clang-format-ignore @@ -1,5 +1,6 @@ **/Pods/** **/build/** +**/metainternal/** **/node_modules/** packages/react-native/React/I18n/FBXXHashUtils.h packages/react-native/ReactAndroid/src/main/jni/first-party/yogajni/** diff --git a/.prettierignore b/.prettierignore index a2c77e3527d..2c9d8e9bc2e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,12 +1,19 @@ # Ignore Pods **/Pods +**/metainternal/** # Ignore hermes as it is downloaded from the react_native_pods **/sdks/hermes **/sdks/downloads +flow-typed/npm/** packages/*/dist vendor packages/**/types_generated/ +packages/react-native/ReactNativeApi.d.ts +packages/react-native/Libraries/Renderer/** +packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +packages/react-native-babel-preset/src/__tests__/__fixtures__/output/** +private/eslint-plugin-monorepo/rules/sort-imports.js packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModule.js diff --git a/scripts/format-java.js b/scripts/format-java.js index d991b6b3892..cba29c9af17 100644 --- a/scripts/format-java.js +++ b/scripts/format-java.js @@ -25,6 +25,7 @@ const IGNORE = [ '**/Pods/**', '**/build/**', '**/com/facebook/yoga/**', + '**/metainternal/**', '**/node_modules/**', ]; diff --git a/scripts/format-kotlin.js b/scripts/format-kotlin.js index 9879f9bcbf9..9e42ec8c9dd 100644 --- a/scripts/format-kotlin.js +++ b/scripts/format-kotlin.js @@ -27,6 +27,7 @@ const IGNORE = [ '**/com/facebook/yoga/**', '**/hermes-engine/**', '**/internal/featureflags/**', + '**/metainternal/**', '**/node_modules/**', '**/systeminfo/ReactNativeVersion.kt', ]; diff --git a/scripts/format-python.js b/scripts/format-python.js index ba7dcb745ca..a358e701cd1 100644 --- a/scripts/format-python.js +++ b/scripts/format-python.js @@ -17,6 +17,11 @@ const path = require('node:path'); const REPO_ROOT = path.resolve(__dirname, '..'); const RUFF_VERSION = '0.14.0'; +// Passed to Ruff as `--config `, which overrides only this single +// setting and leaves any discovered configuration files in place. The +// `--exclude` flag cannot be used instead: it replaces Ruff's default +// exclusions (`node_modules`, `build`, …) rather than adding to them. +const RUFF_CONFIG = 'extend-exclude = ["**/metainternal/**"]'; const RUFF_ROOT = path.join( REPO_ROOT, 'node_modules', @@ -99,7 +104,12 @@ function runRuff(command, prefixArguments, check) { } const format = run(command, [ ...prefixArguments, + '--config', + RUFF_CONFIG, 'format', + // Ruff ignores RUFF_CONFIG's exclusions for any path named explicitly on + // the command line unless exclusions are forced. + '--force-exclude', ...(check ? ['--check'] : []), '.', ]); @@ -193,7 +203,10 @@ function main() { ...python.prefixArguments, '-m', 'ruff', + '--config', + RUFF_CONFIG, 'format', + '--force-exclude', ...(check ? ['--check'] : []), '.', ], diff --git a/scripts/format-swift.js b/scripts/format-swift.js index 74885bd7d79..c944d98311d 100644 --- a/scripts/format-swift.js +++ b/scripts/format-swift.js @@ -27,7 +27,12 @@ const MINIMUM_SWIFT_FORMAT_MAJOR = 6; const MINIMUM_SWIFT_FORMAT_MINOR = 3; const MAX_FILES_PER_PROCESS = 100; const MAX_HEADER_BYTES = 4096; -const IGNORE = ['**/Pods/**', '**/build/**', '**/node_modules/**']; +const IGNORE = [ + '**/Pods/**', + '**/build/**', + '**/metainternal/**', + '**/node_modules/**', +]; function isGenerated(file) { let fd;