It is possible for your contribution to be so bad that it is actually harmful that you tried in the first place - but that's a pretty extreme situation.
For the benefit of both the maintainers and the contributors, projects should really have advanced, comprehensive, automated code linting/style-checking/safety/etc. It should be possible to run it locally, and it should also integrate with GitHub's Pull Requests with automated comments (e.g. Travis CI).
This should instil confidence in the contributor, they know they have at least passed the basic checks.
For the benefit of both the maintainers and the contributors, projects should really have advanced, comprehensive, automated code linting/style-checking/safety/etc. It should be possible to run it locally, and it should also integrate with GitHub's Pull Requests with automated comments (e.g. Travis CI).
This should instil confidence in the contributor, they know they have at least passed the basic checks.