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

Welcome! Here are some resources to get started... #8

Open
DeloitteGitHub opened this issue Nov 11, 2022 · 0 comments
Open

Welcome! Here are some resources to get started... #8

DeloitteGitHub opened this issue Nov 11, 2022 · 0 comments

Comments

@DeloitteGitHub
Copy link

Welcome

This issue was automatically created by the ECR Service Layer. Below are some learning resources to help you get started. If you have questions or want to give feedback feel free to create a discussion or open a issue.

Learning Resources

Best Practices

General best practices when working with code and repositories.

Repositories

Common best practices for any repository regardless of language or purpose.

Best Practices

1. Don't push straight to main/master

Your repositories should always have branch protection on important branches. Changes should go through a pull request and a peer review process to help protect your code.

2. Use devcontainers

Devcontainers is a tool that allows you to run your code in a container. It is a great way to run your code in a container and avoid the need to install dependencies. It helps ensure that your code is always running the same way. It also helps reduce the onboarding time for new developers. You can learn more about devcontainers here

3. Create a contributor guide

The contributor guide is generally a markdown file named CONTRIBUTING.md located in the root of your project. This guide should be a step-by-step guide to help new contributors get started.

4. Define code owners

Even in small teams defining code owners can help productivity. A code owner is a person or team that should be responsible for reviewing changes to certain files or file types.

5. Don't leak secrets in source code

This one is obvious, but accidents happen. Secrets should be stored outside of source control in something like Vault or AWS Secrets manager. In github if you want to use secrets in your pipeline you can leverage repository or environment secrets.

6. Don't commit dependencies or binaries into source control

If you have a dependencies they should be stored in a package manager. Committing binaries into source control increases code size.

7. Use a .gitignore file to prevent unwanted files

A .gitignore file helps prevent the commit of unwanted files. For example you can add the node_modules to your .gitignore to prevent the commit of locally installed npm packages.

8. Use workflows to build and test

You can setup workflows to run tests, build, and deploy your code. A common use case is running unit tests and style linting when pull requests are made.


Coding Languages

Common best practices for a specific language.

Python

1. Code should have tests

It is important to have tests for your code. This helps ensure that your code is working as expected. It helps prevent introducing bugs, and it helps prevent regressions. There are many testing frameworks available for python. pytest is a popular testing framework.

2. Use a code linter

Code should be linted to ensure that it follows the style guidelines. There are many code linters available for python. flake8 is a popular code linter.

3. Code should be documented

Functions and classes should have docstrings. This helps to document the code and make it easier to understand. There are also many tools that can generate webpages from docstrings.


Deloitte Resources

Help

You can email us on our DL: US TI Enterprise Code Repository (ustienterprisecoderepository@deloitte.com)

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

No branches or pull requests

1 participant