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

Change authors to list[dict['name' | 'url' | ..., str]] #70

Merged
merged 12 commits into from
Sep 22, 2024

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Sep 22, 2024

closes #69, allows different URLs for each author (if multiple)

DanielYang59 and others added 2 commits September 22, 2024 17:49
Copy link
Owner

@janosh janosh left a comment

Choose a reason for hiding this comment

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

thanks a lot @DanielYang59! 👍

i think this is ready to go. anything left from your side?

@DanielYang59
Copy link
Contributor Author

DanielYang59 commented Sep 22, 2024

Ah you are so quick. I haven't got time to look into the script yet, looks like you fixed it? Thanks.

Also it appears we cannot execute from the data directory, 93027da should fix this.

(venv) yang@Yang-MacBook data % ls
applications.yml make_readme.py   packages.yml     posts.yml        publications.yml repos.yml        videos.yml

(venv) yang@Yang-MacBook data % pwd
/Users/yang/developer/awesome-normalizing-flows/data

(venv) yang@Yang-MacBook data % ./make_readme.py 
Traceback (most recent call last):
  File "/Users/yang/developer/awesome-normalizing-flows/data/./make_readme.py", line 103, in <module>
    key: {"title": titles[key], "items": load_items(key), "markdown": ""}
                                         ^^^^^^^^^^^^^^^
  File "/Users/yang/developer/awesome-normalizing-flows/data/./make_readme.py", line 48, in load_items
    with open(f"{ROOT_DIR}/data/{key}.yml", encoding="utf8") as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/yang/developer/awesome-normalizing-flows/data/data/publications.yml'

@DanielYang59 DanielYang59 marked this pull request as ready for review September 22, 2024 12:36
@janosh janosh added the enhancement New feature or request label Sep 22, 2024
@janosh janosh merged commit a59d334 into janosh:main Sep 22, 2024
3 of 4 checks passed
- name: Maxim Ulrich
- name: Tamim Asfour
- name: Andreas Krause
- name: Jonas Rothfuss
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry looks like I indeed missed some despite going through this twice, thanks for catching these!

Copy link
Owner

Choose a reason for hiding this comment

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

i have auto-format on save :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe you mentioned this before, but for some reason the formatter doesn't seem to work for me. I installed the YAML- Red Hat from the VS Code extension market, and added the following to my settings.json:

"[yaml]": {
        "editor.defaultFormatter": "redhat.vscode-yaml"
    },

But it still allows saving incorrectly formatted yaml file without auto-format (only a red mark would be shown):
image

Copy link
Owner

Choose a reason for hiding this comment

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

i have "editor.defaultFormatter": "esbenp.prettier-vscode" in settings.json

we could add one of these hooks to .pre-commit-config.yaml to automate the formatting

  - repo: https://github.com/google/yamlfmt
    rev: v0.10.0
    hooks:
      - id: yamlfmt
        args: [-formatter, retain_line_breaks=true]

  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v4.0.0-alpha.8
    hooks:
      - id: prettier
        args: [--write] # edit files in-place

Copy link
Contributor Author

@DanielYang59 DanielYang59 Sep 24, 2024

Choose a reason for hiding this comment

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

Brilliant! It makes sense to install an automatic hook to format these.

For the prettier hooks, it wouldn't not work and has been archived:

prettier made some changes that breaks plugins entirely

Also I'm a bit unsure why the check-yaml doesn't seem to do anything?

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: check-symlinks
- id: check-yaml
- id: destroyed-symlinks
- id: end-of-file-fixer
exclude_types: [svg]
- id: forbid-new-submodules
- id: mixed-line-ending
- id: trailing-whitespace

Copy link
Owner

Choose a reason for hiding this comment

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

check-yaml only checks that all YAML are valid and parseable. it doesn't care about formatting.

For the prettier hooks, it wouldn't not work and has been archived:

thanks for letting me know! i missed that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for letting me know!

thanks for letting me know too :)

@DanielYang59 DanielYang59 deleted the authors-to-dict branch September 22, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple authors need multiple authors_urls
3 participants