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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To add rigorous test coverage or good README examples to your project, you may write a nontrivial amount of test/example code that you don't intend users of your library to ever use. For example for a parsing library you might create an example AST type and a dozen terms to piece together to build a parser for it. This is great for your README, but you don't necessarily want your example.lambdaCalculus.parser.var to show up as an autocomplete result for anyone who depends on your parser library.
It would be nice to have some simple solution to this.
I can think of two categories of solutions to this:
These tests and examples live somewhere that isn't even pulled when a user pulls your library as a dependency.
These tests and examples get pulled in with your library, but test/example definitions don't show up as results for autocomplete/etc.
I was thinking that a simple rule for a solution in category 2 might be to not have autocomplete/find/etc descend into namespace paths that start with _. However, this may be awkward when you are working on the library itself and are writing tests/examples.
Another option might be to special case some path names like tests/examples similarly to how the lib namespace is currently special. But there may be cases other than tests/examples that I'm not thinking of, so this could become a bit ad-hoc.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
To add rigorous test coverage or good README examples to your project, you may write a nontrivial amount of test/example code that you don't intend users of your library to ever use. For example for a parsing library you might create an example AST type and a dozen terms to piece together to build a parser for it. This is great for your README, but you don't necessarily want your
example.lambdaCalculus.parser.var
to show up as an autocomplete result for anyone who depends on your parser library.It would be nice to have some simple solution to this.
I can think of two categories of solutions to this:
I was thinking that a simple rule for a solution in category
2
might be to not have autocomplete/find/etc descend into namespace paths that start with_
. However, this may be awkward when you are working on the library itself and are writing tests/examples.Another option might be to special case some path names like
tests
/examples
similarly to how thelib
namespace is currently special. But there may be cases other than tests/examples that I'm not thinking of, so this could become a bit ad-hoc.Beta Was this translation helpful? Give feedback.
All reactions