danielstjules / jsinspect

Detect copy-pasted and structurally similar code
MIT License
3.56k stars 128 forks source link

0.11.4 ignores matches configuration? #55

Closed matthargett closed 7 years ago

matthargett commented 7 years ago

We have this in our .jsinspectrc:

{
  "threshold":     40,
  "identifiers":   false,
  "matches":       3,
  "ignore":        "Test.js|Spec.js|Colors.js|Images.js", // used as RegExp,
  "jsx":           true,
  "reporter":      "default",
  "suppress":      100
}

But are getting reports like this after upgrading to 0.11.4 even though 'matches' is set to 3:

Match - 2 instances

./App/Components/InMeeting/CallControlHeader.js:41,43
<View style={Styles.center}>
  { !videoMuted && <ControlButton icon={Images.camera} title={'VIDEO ON'} onPress={videoMute} /> }
  { videoMuted && <ControlButton icon={Images.cameraOff} title={'VIDEO OFF'} onPress={videoUnmute} off /> }

./App/Containers/DashboardLayout.js:118,120
<View style={Styles.topControls}>
  { !videoMuted && <ControlButton icon={Images.camera} title={'VIDEO ON'} onPress={videoMute} /> }
  { videoMuted && <ControlButton icon={Images.cameraOff} title={'VIDEO OFF'} onPress={videoUnmute} off /> }

------------------------------------------------------------
danielstjules commented 7 years ago

0.10 saw a lot of breaking changes, which included:

--matches became --min-instances

Sorry about that! Should be able to just replace matches with minInstances in your config

matthargett commented 7 years ago

Thanks for updating the README!