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

Field comments #172

Merged
merged 8 commits into from
Jan 23, 2018
Merged

Field comments #172

merged 8 commits into from
Jan 23, 2018

Conversation

clavoie-takt
Copy link
Contributor

@clavoie-takt clavoie-takt commented Jan 19, 2018

Revive @judah 's old field-comments branch, and prettify the output a wee bit.


This change is Reviewable

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@clavoie-takt
Copy link
Contributor Author

CLA ping -- bot should now rubberstamp.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@judah judah self-requested a review January 19, 2018 22:41
@judah
Copy link
Collaborator

judah commented Jan 19, 2018

Confirming that I am OK with my commit being used here.

Copy link
Collaborator

@judah judah left a comment

Choose a reason for hiding this comment

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

A couple small comments; also, please take a look at the two errors in CI (let me know if you have trouble reproducing them): https://travis-ci.org/google/proto-lens/builds/331017983?utm_source=github_status&utm_medium=notification

@@ -28,7 +28,10 @@ import Data.String (fromString)
import Data.Text (unpack)
import qualified Data.Text as T
import Data.Tuple (swap)
import qualified Language.Haskell.Exts.Syntax as Syntax
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't import this module directly; we're intentionally using the Combinators module as a shim. If necessary, add more exports to that module instead.

In particular, you can get ModuleName from it: https://github.com/google/proto-lens/blob/master/proto-lens-protoc/src/Data/ProtoLens/Compiler/Combinators.hs#L218

messageComment :: Name -> [RecordField] -> String
messageComment n fields = unlines
messageComment :: Syntax.ModuleName () -> Name -> [RecordField] -> String
messageComment (Syntax.ModuleName _ fieldModName) n fields = unlines
Copy link
Collaborator

Choose a reason for hiding this comment

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

ModuleName is an instance of Pretty, so I believe you can just use prettyPrint here instead of unwrapping the constructor.

@clavoie-takt
Copy link
Contributor Author

clavoie-takt commented Jan 22, 2018 via email

@judah judah merged commit 8898a86 into google:master Jan 23, 2018
judah added a commit to judah/proto-lens that referenced this pull request Jan 24, 2018
Now that we define our own `Module` type (google#172), we don't need `getModuleName`
to return a `Maybe`.
@judah judah mentioned this pull request Jan 24, 2018
judah added a commit that referenced this pull request Jan 24, 2018
Now that we define our own `Module` type (#172), we don't need `getModuleName`
to return a `Maybe`.
judah added a commit to judah/proto-lens that referenced this pull request Jan 30, 2018
They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation.  Now
that google#172 has landed, we have a better source of documentation that doesn't
expose internal details.

Also change the "Show" instance for messages to be a wrapper around
`showMessageShow`.  This both hides the now-inaccessible record fields and
shortens the output in most cases.  For example:

```> print (def :: DescriptorProto)
{}
> print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto)
{name: "hello" field { } field { name: "bye" }}
```

Also bump the resolver for bootstrapping to match the regular build.

Hide message constructors.

showsPrec, and bootstrap
judah added a commit to judah/proto-lens that referenced this pull request Jan 30, 2018
They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation.  Now
that google#172 has landed, we have a better source of documentation that doesn't
expose internal details.

Also change the "Show" instance for messages to be a wrapper around
`showMessageShow`.  This both hides the now-inaccessible record fields and
shortens the output in most cases.  For example:

```
> print (def :: DescriptorProto)
{}
> print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto)
{name: "hello" field { } field { name: "bye" }}
```

Also bump the resolver for bootstrapping to match the regular build.

Hide message constructors.

showsPrec, and bootstrap
judah added a commit to judah/proto-lens that referenced this pull request Jan 30, 2018
They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation.  Now
that google#172 has landed, we have a better source of documentation that doesn't
expose internal details.

Also change the `Show` instance for messages to be a wrapper around
`showMessageShort`.  This both hides the now-inaccessible record fields and
shortens the output in most cases.  For example:

```
> print (def :: DescriptorProto)
{}
> print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto)
{name: "hello" field { } field { name: "bye" }}
```

Also bump the resolver for bootstrapping to match the regular build.

Hide message constructors.

showsPrec, and bootstrap
judah added a commit to judah/proto-lens that referenced this pull request Jan 30, 2018
They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation.  Now
that google#172 has landed, we have a better source of documentation that doesn't
expose internal details.

Also change the `Show` instance for messages to be a wrapper around
`showMessageShort`.  This both hides the now-inaccessible record fields and
shortens the output in most cases.  For example:

```
> print (def :: DescriptorProto)
{}
> print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto)
{name: "hello" field { } field { name: "bye" }}
```

Also bump the resolver for bootstrapping to match the regular build.

Hide message constructors.

showsPrec, and bootstrap
judah added a commit to judah/proto-lens that referenced this pull request Jan 30, 2018
They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation.  Now
that google#172 has landed, we have a better source of documentation that doesn't
expose internal details.

Also change the `Show` instance for messages to be a wrapper around
`showMessageShort`.  This both hides the now-inaccessible record fields and
shortens the output in most cases.  For example:

```
> print (def :: DescriptorProto)
{}
> print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto)
{name: "hello" field { } field { name: "bye" }}
```

Also bump the resolver for bootstrapping to match the regular build.

Hide message constructors.

showsPrec, and bootstrap
judah added a commit that referenced this pull request Aug 26, 2018
Finishes #158.

They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation.  Now
that #172 has landed, we have a better source of documentation that doesn't
expose internal details.

Also change the `Show` instance for messages to be a wrapper around
`showMessageShort`.  This both hides the now-inaccessible record fields and
shortens the output in most cases.  For example:

```
> print (def :: DescriptorProto)
{}
> print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto)
{name: "hello" field { } field { name: "bye" }}
```

Also bump the resolver for bootstrapping to match the regular build.
avdv pushed a commit to avdv/proto-lens that referenced this pull request Aug 9, 2023
Add haddock comments which give better documentation for fields lens docs for fields and link them to their long-form variants.
avdv pushed a commit to avdv/proto-lens that referenced this pull request Aug 9, 2023
Now that we define our own `Module` type (google#172), we don't need `getModuleName`
to return a `Maybe`.
avdv pushed a commit to avdv/proto-lens that referenced this pull request Aug 9, 2023
…#174)

Finishes google#158.

They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation.  Now
that google#172 has landed, we have a better source of documentation that doesn't
expose internal details.

Also change the `Show` instance for messages to be a wrapper around
`showMessageShort`.  This both hides the now-inaccessible record fields and
shortens the output in most cases.  For example:

```
> print (def :: DescriptorProto)
{}
> print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto)
{name: "hello" field { } field { name: "bye" }}
```

Also bump the resolver for bootstrapping to match the regular build.
ylecornec pushed a commit to ylecornec/proto-lens that referenced this pull request Feb 19, 2024
Add haddock comments which give better documentation for fields lens docs for fields and link them to their long-form variants.
ylecornec pushed a commit to ylecornec/proto-lens that referenced this pull request Feb 19, 2024
…#174)

Finishes google#158.

They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation.  Now
that google#172 has landed, we have a better source of documentation that doesn't
expose internal details.

Also change the `Show` instance for messages to be a wrapper around
`showMessageShort`.  This both hides the now-inaccessible record fields and
shortens the output in most cases.  For example:

```
> print (def :: DescriptorProto)
{}
> print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto)
{name: "hello" field { } field { name: "bye" }}
```

Also bump the resolver for bootstrapping to match the regular build.
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.

None yet

4 participants