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

Track generated code and data #682

Closed
szepeviktor opened this issue Oct 12, 2023 · 7 comments
Closed

Track generated code and data #682

szepeviktor opened this issue Oct 12, 2023 · 7 comments

Comments

@szepeviktor
Copy link
Contributor

szepeviktor commented Oct 12, 2023

Could we have a list of generated code/data in .gitattributes?

# An example
/package-lock.json linguist-generated

Something like this.

package-lock.json
packages/docs/site/static/diagrams.excalidraw
packages/php-wasm/compile/build-assets/zlib/
packages/php-wasm/node/public/
packages/php-wasm/node/src/test/test-data/
packages/php-wasm/web/public/php_*
packages/playground/remote/public/wp-*
packages/playground/remote/src/wordpress/

⚠️ I do not know the internals of this repo. This is purely a guess.

From #678

@adamziel
Copy link
Collaborator

@szepeviktor I'm not super familiar with .gitattributes – what would be an advantage of maintaining such a list?

@szepeviktor
Copy link
Contributor Author

For example. I was checking to typos in the repository and was not able to distinguish source code from generated code/data.

Another example. GitHub displays generated files differently.
https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#summary

@szepeviktor
Copy link
Contributor Author

packages/php-wasm/compile/build-assets/zlib/ is "linguist-vendored"

@adamziel
Copy link
Collaborator

Thank you for explaining!

@adamziel
Copy link
Collaborator

adamziel commented Oct 12, 2023

Your guess was quite close @szepeviktor. This should be the complete list:

package-lock.json linguist-generated
packages/docs/site/static/diagrams.excalidraw linguist-vendored
packages/php-wasm/compile/build-assets/zlib/ linguist-vendored
packages/php-wasm/node/public/ linguist-generated
packages/php-wasm/node/src/test/test-data/ linguist-generated
packages/php-wasm/web/public/kitchen-sink/ linguist-generated
packages/php-wasm/web/public/light/ linguist-generated
packages/playground/remote/public/wp-* linguist-generated
packages/playground/remote/src/wordpress/ linguist-generated
packages/playground/blueprints/public/ linguist-generated

adamziel added a commit that referenced this issue Oct 12, 2023
Add a .gitattributes file to easier distinguish source code from
generated code/data. Also, GitHub displays generated files differently.

See
https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#summary

Solves #682
@adamziel
Copy link
Collaborator

adamziel commented Oct 12, 2023

Shipped with some tweaks in #688

@szepeviktor
Copy link
Contributor Author

Thank you.
This command shows what is up: git ls-files --cached | git check-attr --stdin --all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants