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

feat: support for file headers #183

Merged
merged 188 commits into from
Aug 4, 2022
Merged

feat: support for file headers #183

merged 188 commits into from
Aug 4, 2022

Conversation

kevgo
Copy link
Contributor

@kevgo kevgo commented Jul 22, 2022

This enables Ory CLI to add headers to source code files in various ways. I decided to build (vs buy) this because that was needed for feature (2) anyways, and I could reuse the functionality to add headers to build a solution for (1) that is custom-tailored to our unique setup.

This PR adds two main capabilities to Ory CLI's dev tooling:

  1. add license headers to all files in a folder (implements https://github.com/ory-corp/general/issues/602)

    • call like this: cli dev headers license .
    • adds a license header to all files that can contain comments
    • does not add license headers to .md files
    • the license header text is baked into the tool for now since it should be always the same
    • preview of how the result looks like: docs: standardize license headers hydra#3216
  2. add link to original file in ory/meta while replicating from ory/meta to all Ory repos (implements idea: add header to file copies that mentions they are auto-generated and links to the original meta#149)

    • call like this: cli dev headers cp [-r] <source> <destination>
    • behaves exactly similar to cp -r around which files are copied (if not that's a bug in this tool)
    • for each file it copies, it adds a header to the new file pointing to the original file on GitHub
    • this is currently hard-coded to ory/meta since that's the only source of file replication I am aware of right now
    • preview of how the result looks like: DEMO: example header for replicated file hydra#3217

This is an alpha release. Fine-tuning is expected as this is being used more widely.

Related Issue or Design Document

ory/meta#149 and https://github.com/ory-corp/general/issues/602

Checklist

  • I have read the contributing guidelines
    and signed the CLA.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added necessary documentation within the code base (if
    appropriate).

@kevgo kevgo marked this pull request as ready for review August 3, 2022 20:46
Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Awesome, let's give this a spin! :)

@aeneasr aeneasr merged commit 04d0d5b into ory:master Aug 4, 2022
@kevgo kevgo deleted the kg-header branch August 4, 2022 14:21
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