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

Purpose: Lint and style check ObjectiveC code #1916

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@ptmt
Copy link
Contributor

ptmt commented Jul 9, 2015

It's hard to contribute to native part of react-native for me. Of course tests are the most important, but do you consider adding linters too?
Linters also could distract and restrict too much. Now it looks like this:

...
react-native/React/Views/RCTNavItem.m:53:3: ivar assignment outside accessors or init P2
...
react-native/React/Modules/RCTUIManager.m:525:7: long variable name P3 Variable name with 21 characters is longer than the threshold of 20
...
react-native/React/Modules/RCTUIManager.m:1114:1: deep nested block P3 Block depth of 6 exceeds limit of 5
...
react-native/React/Modules/RCTUIManager.m:81:1: high npath complexity P2 NPath Complexity Number 258 exceeds limit of 200
...
react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.m:87:31: unused method parameter P3 The parameter 'application' is unused.
...
P1=0[0] P2=339[10] P3=545[20]

(P for Priority)

  • Add oclint and ocstyle (or write custom rules for oslint for consistent code styling conventions, sush as whitespaces, new lines, code blocks formatting, etc.).
  • Setup rules such as CODE_COMPLEXITY to avoid most of the current warnings and adopt linter to react-native conventions. Update code to Suppress OCLint Warnings.
  • Leave it as an option just for contributors and if it will work properly for a certain time then eventually add it to .travisci
@sahrens

This comment has been minimized.

Copy link
Contributor

sahrens commented Jul 14, 2015

Cool, would be great to have objC lint - not sure what the best option is though, so passing to Nick.

@ptmt

This comment has been minimized.

Copy link
Contributor Author

ptmt commented Nov 25, 2015

A bit of naive approach.

@ptmt ptmt closed this Nov 25, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.