Coder Social home page Coder Social logo

Comments (8)

jmatzdorff-cpi avatar jmatzdorff-cpi commented on June 20, 2024 1

i tried pushing changes upstream to a branch that i created - so as to make a PR. but i don't seem to have permissions to do that to your repo. So not sure how to do any changes.

i updated as you mentioned (also added in a "=" sign character because i find it helpful to have in the doc string "default=" as well) and updated the tests. but not sure how i can push that up.

from pdoc.

kernc avatar kernc commented on June 20, 2024

The first line of the regex already accounts for parenthesized types (not arbitrary parameters):

re.compile(r'^([\w*]+)(?: \(([\w. ]+)\))?: '

See the test example: https://pdoc3.github.io/pdoc/doc/pdoc/test/example_pkg/index.html#pdoc.test.example_pkg.google

You make your regex accept .* in parentheses, but I think simply adding comma to the list of accepted characters (:+1:) would work for your case:

re.compile(r'^([\w*]+)(?: \(([\w., ]+)\))?: '

Since docstring conversion is applied automatically, we limit the possibility for false positives if we don't make it match .*. Do you feel you need any other characters besides comma, and why?

Additionally, in your example you have no space between the argument name and parenthesized parameter. A regex like this (:+1:) would support that as well.

re.compile(r'^([\w*]+)(?: *\(([\w., ]+)\))?: '

from pdoc.

kernc avatar kernc commented on June 20, 2024

Would you like to make a pull request for that?

i am having a slight issue getting the test to run.

What issue are you having?

from pdoc.

jmatzdorff-cpi avatar jmatzdorff-cpi commented on June 20, 2024

ah, you are correct ... my code started out with using comma character and didn't work and so i went to fixing that before i even tried testing with just a single type, which led me to thinking it didn't work at all. apologies.

no i can't imagine needing any other character other than comma (and even that i suppose is debatable, but i think google style is supposed to support that).

adding the comma to the regex works great. i also didn't realize it converts it to numpy-style on the output (rather than keeping the original formatting, such as "var (int): description"). jumped too many guns there.

i'll submit a PR with a test here in a bit.

i was being a bit cheekish with my comment about getting tests to run. my issue was that i didn't want to take the time to do it ;) -- but i have them up and running now.

from pdoc.

kernc avatar kernc commented on June 20, 2024

Still interested? Need any help? 😃

from pdoc.

kernc avatar kernc commented on June 20, 2024

Yes, you can't just push to this repo. First you fork and make your own repo and push to a branch on it. Then, GitHub will permit (and recommend) you to do a pull request: https://gist.github.com/Chaser324/ce0505fbed06b947d962

from pdoc.

kernc avatar kernc commented on June 20, 2024

@jmatzdorff-cpi Happy for you to finish this. 👍

You can add your own remote to your checkout with:

# Rename the current remote "origin" (that points to pdoc3/pdoc) to "upstream"
git remote rename origin upstream

# Add new "origin" remote
git remote add origin [email protected]:jmatzdorff-cpi/pdoc.git

# Push your changes to your new "origin" remote 
# regardless of what the branch tracking is set to
git push origin HEAD:fix-3
# Note, this will create a new remote feature branch "fix3".

Afterwards when you go to pdoc3/pdoc, GitHub UI should propose a PR from the newly-pushed branch.

from pdoc.

jmatzdorff-cpi avatar jmatzdorff-cpi commented on June 20, 2024

well, when you give me exact steps; i can't exactly say i don't what to do :)

anyhow, it's pushed and PR requested!

from pdoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.