Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EMBR-4352] Run Swiftlint/Clang-format over RN iOS module #83

Closed
wants to merge 16 commits into from

Conversation

facostaembrace
Copy link
Contributor

@facostaembrace facostaembrace commented Aug 24, 2024

Test

given this failure had to revert this format change. To analyze how this string is working and if it is safe just to fix the test with the new format of the file.

UPDATE: previous issue was fixed. Unit tests work fine after tweaks on strings.

Goal

  • adding Swiftlint for swift files (yarn lint:swift)
  • adding linter for Objective-c files (yarn lint:clang)
  • adding script for linting js files only into packages/** directory (yarn lint:js). NOTE: the base yarn lint cover json files, and json files are also into ios/android directories making the plugin to run into the entire project (resulting in unexpected behaviors)
  • adding husky to run linters when commiting

@facostaembrace facostaembrace force-pushed the facosta/objective-c-linter-clang-format branch from 8fe6dd7 to 8e32a86 Compare August 30, 2024 19:33
@facostaembrace facostaembrace changed the title (linter): Adding Objective-C formatter + husky [EMBR-4352] Run Swiftlint/Clang-format over RN iOS module Aug 30, 2024
Copy link

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.56%. Comparing base (f6a057b) to head (14ed5b7).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #83   +/-   ##
=======================================
  Coverage   78.56%   78.56%           
=======================================
  Files          28       28           
  Lines        1241     1241           
  Branches       99       92    -7     
=======================================
  Hits          975      975           
  Misses        266      266           
Files with missing lines Coverage Δ
packages/core/scripts/setup/patches/patch.ts 86.27% <ø> (ø)
packages/core/scripts/setup/uninstall.ts 80.00% <ø> (ø)
packages/core/scripts/util/ios.ts 72.44% <100.00%> (ø)

@facostaembrace facostaembrace marked this pull request as ready for review September 2, 2024 13:55
@facostaembrace facostaembrace requested a review from a team September 2, 2024 13:55
Copy link
Contributor

@jpmunz jpmunz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I think this would be good to hook up to the github workflow as well

when merging 5.0 we should remember remove the extra .swiftlint.yml files added there

"publish-modules": "npx lerna run build && npx lerna publish",
"build": "npx lerna run build",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix && prettier --write \"**/*.{js,jsx,ts,tsx,json}\" && yarn constraints --fix",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this regular lint command still needed given the others we have now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, the only difference is the json part and honestly I usually do not run this script. I can remove it if doesn't seems to be useful for you as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya I think we can just remove

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one will conflict since we fully changed it on 5.0, might be better to not update as part of this PR

Copy link
Contributor Author

@facostaembrace facostaembrace Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is why I would prefer to wait until we make the releases and then after all merge this pr and run linters again

export const EMBRACE_INIT_OBJECTIVEC =
"[[Embrace sharedInstance] startWithLaunchOptions:launchOptions framework:EMBAppFrameworkReactNative];";
export const EMBRACE_INIT_OBJECTIVEC = `[[Embrace sharedInstance] startWithLaunchOptions:launchOptions
framework:EMBAppFrameworkReactNative];`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this change, since it's injected into the customer's app delegate I think this will end up including extra whitespace

@facostaembrace facostaembrace requested a review from a team as a code owner October 15, 2024 14:35
Copy link

Dependency Review

The following issues were found:

  • ❌ 9 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses.
  • ⚠️ 4 packages with OpenSSF Scorecard issues.

View full job summary

@facostaembrace facostaembrace deleted the facosta/objective-c-linter-clang-format branch October 15, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants