Skip to content

Feature used parameter expectation - #266

Draft
flbulgarelli wants to merge 7 commits into
masterfrom
feature-used-parameter-expectation
Draft

flbulgarelli wants to merge 7 commits into
masterfrom
feature-used-parameter-expectation

Conversation

@flbulgarelli

Copy link
Copy Markdown
Member

This is a work in progress since I want to add this check as an inspection instead of an smell, due to backward compatibility issues.

@julian-berbel julian-berbel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😍

Comment thread spec/SmellSpec.hs
hasUnusedParameters (js "function x(m2, m2) { g(m1); return m2 } ") `shouldBe` False

it "is False when uses all its parameters in return" $ do
hasUnusedParameters (js "function x(m2, m2) { return m1 + m2 } ") `shouldBe` False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe parameters in these two tests should be x(m1, m2)

Comment thread spec/SmellSpec.hs
describe "hasUnusedParameters" $ do
it "is False for methods of all kinds" $ do
hasUnusedParameters (js "var o = {x: function(m) { return 4; }}") `shouldBe` False
hasUnusedParameters (js "var o = {x: function(m) { return m; }}") `shouldBe` False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

makes sense!

This branch has not been deployed

No deployments
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