Skip to content

Commit

Permalink
Updates podfile scans to handle double quotes (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfarrell76 authored Jan 15, 2025
1 parent 337f695 commit 801ba52
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
platform :ios, "14.0"
use_frameworks!
inhibit_all_warnings!
target "Acme" do

# Raizlabs
pod 'RZVinyl', :git =>'[email protected]:test/acme-RZVinyl.git'
pod 'RZTransitions', '1.2.1'
# Acme
pod 'SDWebImage', :git =>'[email protected]:test/acme-SDWebImage.git', :commit => 'c224e87'

# Code Analysis
pod 'SwiftLint'
target 'AcmeTests' do
inherit! :search_paths
pod 'RZVinyl', :git =>'[email protected]:test/acme-RZVinyl.git'
# For UI Snapshot Testing
use_frameworks!
pod 'iOSSnapshotTestCase', '6.2.0'
pod 'SnapshotTesting', '~> 1.8.1'
end

target 'NotificationServiceExtension' do
inherit! :search_paths
end

post_install do |installer|
installer.pods_project.targets.each do |target|

target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
end
end
end
end
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Transcend Inc.",
"name": "@transcend-io/cli",
"description": "Small package containing useful typescript utilities.",
"version": "6.13.1",
"version": "6.13.2",
"homepage": "https://github.com/transcend-io/cli",
"repository": {
"type": "git",
Expand Down Expand Up @@ -59,7 +59,7 @@
"clean": "yarn tsc --build --clean",
"lint": "yarn eslint src --ext .ts",
"prepublish": "yarn build",
"test": "yarn mocha './src/**/*.test.ts'",
"test": "yarn mocha './src/**/*.test.ts' --reporter-option maxDiffSize=0",
"script:transcend-json-schema": "ts-node --transpile-only scripts/buildTranscendJsonSchema.ts && yarn prettier ./transcend-yml-schema-v6.json --write",
"script:pathfinder-json-schema": "ts-node --transpile-only scripts/buildPathfinderJsonSchema.ts && yarn prettier ./pathfinder-policy-yml-schema.json --write"
},
Expand Down
4 changes: 2 additions & 2 deletions src/code-scanning/integrations/cocoaPods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CodePackageSdk } from '../../codecs';
import { findAllWithRegex } from '@transcend-io/type-utils';
import { CodePackageType } from '@transcend-io/privacy-types';

const POD_TARGET_REGEX = /target '(.*?)'/;
const POD_TARGET_REGEX = /target ('|")(.*?)('|")/;
const POD_PACKAGE_REGEX = /pod ('|")(.*?)('|")(, ('|")~> (.+?)('|")|)/;

export const cocoaPods: CodeScanningConfig = {
Expand All @@ -16,7 +16,7 @@ export const cocoaPods: CodeScanningConfig = {
const targets = findAllWithRegex(
{
value: new RegExp(POD_TARGET_REGEX, 'g'),
matches: ['name'],
matches: ['quote1', 'name', 'quote2'],
},
fileContents,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const PREFERENCE_TOPICS: PreferenceTopic[] = [
},
];

describe.only('checkIfPendingPreferenceUpdatesCauseConflict', () => {
describe('checkIfPendingPreferenceUpdatesCauseConflict', () => {
it('should return false for simple purpose comparison', () => {
expect(
checkIfPendingPreferenceUpdatesCauseConflict({
Expand Down
51 changes: 51 additions & 0 deletions src/tests/findCodePackagesInFolder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,57 @@ describe('findCodePackagesInFolder', () => {
relativePath: 'test-requirements-txt/nested-cocoapods/Podfile',
repositoryName: 'transcend-io/cli',
},
{
name: 'Acme',
relativePath: 'test-requirements-txt/nested-cocoapods-2/Podfile',
repositoryName: 'transcend-io/cli',
softwareDevelopmentKits: [
{
name: 'RZVinyl',
version: undefined,
},
{
name: 'RZTransitions',
version: undefined,
},
{
name: 'SDWebImage',
version: undefined,
},
{
name: 'SwiftLint',
version: undefined,
},
],
type: 'COCOA_PODS',
},
{
name: 'AcmeTests',
type: 'COCOA_PODS',
softwareDevelopmentKits: [
{
name: 'RZVinyl',
version: undefined,
},
{
name: 'iOSSnapshotTestCase',
version: undefined,
},
{
name: 'SnapshotTesting',
version: '1.8.1',
},
],
relativePath: 'test-requirements-txt/nested-cocoapods-2/Podfile',
repositoryName: 'transcend-io/cli',
},
{
name: 'NotificationServiceExtension',
relativePath: 'test-requirements-txt/nested-cocoapods-2/Podfile',
repositoryName: 'transcend-io/cli',
softwareDevelopmentKits: [],
type: 'COCOA_PODS',
},
{
name: 'com.yourcompany.yourapp',
softwareDevelopmentKits: [
Expand Down

0 comments on commit 801ba52

Please sign in to comment.