warn('You are logging data. Please confirm that nothing sensitive is being logged!')
}
// Check for usage of FlatList, FlashList, VirtualizedList, or ScrollView in modals
allLinesAdded.forEach((change)=>{
if(
change.content.includes('FlatList')||
change.content.includes('FlashList')||
change.content.includes('VirtualizedList')||
change.content.includes('ScrollView')
){
warn(
`Detected usage of ${change.content.match(/FlatList|FlashList|VirtualizedList|ScrollView/g)?.join(', ')}. If it's used in a modal, please use the appropriate import from '@gorhom/bottom-sheet' instead.`,
`Detected import from '@gorhom/bottom-sheet' for ${change.content.match(/BottomSheetScrollView|BottomSheetFlatList|BottomSheetFlashList/g)?.join(', ')}. Consider adding the focus hook from 'useBottomSheetFocusHook' to ensure scrollables work correctly, especially on Android.`,
)
}
})
// Check for UI package imports that are longer than needed
constendOfImport=change.content.indexOf(`'`,idx+6)// skipping the "from '"
warn(
`It looks like you have a longer import from 'ui/src' than needed ('${change.content.substring(idx+6,endOfImport)}'). Please use one of [${validLongerImports.join(', ')}] when possible!`,
`It appears you may be manually logging a Sentry error. Please log the error directly if possible. If you need to use a custom error message, ensure the error object is added to the 'cause' property.`,
"You've added a new call to `createSelector()`. This is Ok, but please make sure you're using it correctly and you're not creating a new selector on every render. See PR #5172 for details.",
`You're changing the Podfile version! Ensure you are using the correct version. If this change is intentional, you should ignore this check and merge anyways.`,
'Changes were made to .env.defaults. Confirm that no sensitive data is in the .env.defaults file. Sensitive data must go in .env (web) or .env.defaults.local (mobile) and then run `yarn upload-env-local` to store it in 1Password.',
)
}
// Check native and web file splits
checkSplitFiles()
// Run checks on added changes
processAddChanges()
// Check for cocoapods version change
checkCocoaPodsVersion()
// check translations use the correct apostrophes
checkApostrophes()
// check the PR size
checkPRSize()
// No PR is too small to warrant a paragraph or two of summary
if(danger.github.pr.body.length<50){
warn(
'The PR description is looking sparse. Please consider explaining more about this PRs goal and implementation decisions.',
'You have updated the GraphQL schema. Please ensure that the Swift GraphQL Schema generation is valid by running `yarn mobile ios` and rebuilding for iOS. '+
'You may need to add or remove generated files to the project.pbxproj. For more information see `apps/mobile/ios/WidgetsCore/MobileSchema/README.md`',
'You modified a slice file. If you added, renamed, or deleted required properties from state, then make sure to define a new schema and a create a migration.',