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

report eastwood detail urls #124

Merged
merged 7 commits into from
Feb 22, 2020
Merged

report eastwood detail urls #124

merged 7 commits into from
Feb 22, 2020

Conversation

thumbnail
Copy link
Member

@thumbnail thumbnail commented Feb 21, 2020

Brief

the key is a string. conforming it to a keyword.

Now it'l show up in our reports :)

QA plan

green tests

Author checklist

  • I have QAed the functionality
  • The PR has a reasonably reviewable size and a meaningful commit history
  • I have run the branch formatter and observed no new/significative warnings
  • The build passes
  • I have self-reviewed the PR prior to assignment
  • Additionally, I have code-reviewed iteratively the PR considering the following aspects in isolation:
    • Correctness
    • Robustness (red paths, failure handling etc)
    • Modular design
    • Test coverage
    • Spec coverage
    • Documentation
    • Security
    • Performance
    • Breaking API changes
    • Cross-compatibility (Clojure/ClojureScript)

Reviewer checklist

  • I have checked out this branch and reviewed it locally, running it
  • I have QAed the functionality
  • I have reviewed the PR
  • Additionally, I have code-reviewed iteratively the PR considering the following aspects in isolation:
    • Correctness
    • Robustness (red paths, failure handling etc)
    • Modular design
    • Test coverage
    • Spec coverage
    • Documentation
    • Security
    • Performance
    • Breaking API changes
    • Cross-compatibility (Clojure/ClojureScript)

@thumbnail thumbnail requested a review from vemv February 21, 2020 10:10
src/formatting_stack/linters/eastwood.clj Outdated Show resolved Hide resolved
src/formatting_stack/linters/eastwood.clj Outdated Show resolved Hide resolved
thumbnail and others added 4 commits February 21, 2020 12:34
# Conflicts:
#	src/formatting_stack/linters/eastwood.clj
#	test/functional/formatting_stack/linters/eastwood.clj
…ack into eastwood-detail-urls

# Conflicts:
#	test/functional/formatting_stack/linters/eastwood.clj
{:source :eastwood/def-in-def
:line 3
:column 13
:warning-details-url "https://github.com/jonase/eastwood#def-in-def"
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it interesting that match? allows the other test cases within this are to omit :warning-details-url and still pass.

I get why that's like that, but it also leads to:

  • test case heterogeneity
    • having different shapes of data is confusing - it makes me wonder "why the differences? do they have some intent relevant to the thing being tested?"
  • currently only a fraction of the tests in this are exercise the :warning-details-url aspect
    • that literally means we get less coverage
    • it also means that fewer tests act as documentation, which is an important role
  • fragility
    • I can delete random key-value entries in these maps and have the tests still pass
      • The same cannot be said of most testing techniques/frameworks I know

As a tentative conclusion, match? is too DRY, up to the point of self-reference.

IMO a good test compares x against y. If there's only an x and no y, then x becomes a self-referential test (input == expectation).

Of course, #124 is not critical functionality, but as you know I've always been a bit skeptical about match? as a general-purpose tool. Maybe we can begin limiting its usage elsewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

I find it interesting that match? allows the other test cases within this are to omit :warning-details-url and still pass.

The effect you're describing is only one of the matchers (matchers/embeds, default for maps). This behavior is fully configurable.

The default is set to embeds because maps are open to extension exact matches,. Breakage tend to be cumbersome and overwhelming when every are-case fails (e.g. because an extra key is added)

having different shapes of data is confusing

I'd say it might be unfamiliar. I've come to expect these shapes for the big-are clauses which leverage match?

currently only a fraction of the tests in this are exercise the :warning-details-url aspec
- that literally means we get less coverage

It means we get less duplicated coverage, which leads to more specific failures. one are-case failing helps pin-pointing the issue.

I can delete random key-value entries in these maps and have the tests still pass

From the expected-values, yes. the actual values, no.

The same cannot be said of most testing techniques/frameworks I know

It's rather common in Ruby's rspec (have-attributes-matcher, contains_exactly (similar to m/equals), and include), Java's hamcrest (IsIterableContaining, anyOf, arrayContaining, see matchers), python as a hamcrest impl as well.

Copy link
Contributor

@vemv vemv left a comment

Choose a reason for hiding this comment

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

QAed:

image

Happy for this one. Eventually we could have in the wiki explanations for our own linters.

@vemv vemv merged commit 5a2251d into master Feb 22, 2020
@vemv vemv deleted the eastwood-detail-urls branch February 22, 2020 01:52
@vemv vemv mentioned this pull request Feb 22, 2020
7 tasks
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