6

9 essential devtools for new projects

 2 years ago
source link: https://blog.console.dev/9-devtools-to-start-a-new-project/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

9 essential devtools for new projects

• 27 Apr 2022• 5 min read
When starting a new coding project there are lots of devtools to consider using. These are the 9 most important devtools for new projects.

When starting a new coding project there are lots of devtools to consider using. There are so many shiny tools that might be cool to use, but many of them you won’t need until your team is large or the project starts scaling. However, there are some things that are worth getting right - source control, documentation, linting, security alerts - which means there are a few tools that every developer should consider using from the start.

Having reviewed hundreds of devtools at Console, these are the 9 most important devtools to get going with new projects. They’re also worth considering for existing projects. All are free to use and most are open source:

1 - Git & GitHub

git init should be the first step when starting any new project. You might assume that everyone is using source control by now, but you’d be surprised! Maybe it’s overkill if it’s a solo project, but you never know when you might want to roll back changes, work on the code somewhere else, or bring in someone else to help.

Git works anywhere, but the most popular platform for code hosting is GitHub. It works well just as a place to sync code, but you also get all the extra features - issue tracking, pull requests, project planning, security scanning, etc. And if you plan to release the code publicly, it’s where the developer community is.

Alternatives: GitLab and Sourcehut are both cloud hosted GitHub alternatives (also both available self-hosted). Gitea is a self-hosted alternative. Some believe free software should use free software infrastructure.

GitHub screenshot.GitHub screenshot.

2 - lazygit

Git is sometimes considered difficult to use, but the basic commands to stage, commit, and push are relatively simple. For anything more complex, a UI like lazygit is very helpful. It makes it much easier to work with branches, stash changes, and review diffs.

Alternatives: If you use GitHub then the GitHub CLI or GitHub Desktop clients are good options. GitFinder is a paid Git UI for macOS and Git Tower is a freemium client for Mac and Windows.

lazygit.giflazygit animated screenshot.

3 - Trunk

Using a code formatter and linter will help ensure your code looks the same across the project, avoids noisy Git diffs, and will help to avoid common errors. Good languages build this into the standard toolchain, such as Go and Rust, but older languages have also adopted a common toolchain. Prettier is commonly used for web technologies and flake8 is well known for Python, for example.

Trunk is a tool that unifies all these different linters and formatters into a common CLI, combining checks and autofixes into a tool that can be run before pushing code. It makes it a lot easier to work with different languages with a common config, particularly in monorepos.

Disclosure: Console is an investor in Trunk.

trunk-screenshot.pngTrunk screenshot.

4 - Semgrep

Semgrep is a static analysis tool that enforces rules against your codebase. It can be used to check for coding standards compliance, but it is more useful for analyzing code for common issues. It does this through a large library of community provided rulesets, and you can define your own depending e.g. preventing committing AWS keys or requiring developers to use your logging framework.

Semgrep also integrates with Trunk, but I’ve listed it independently because you need to spend some time configuring the rules for your project whereas most developers can use the default linting and formatting configurations.

Disclosure: Semgrep is a past Console Newsletter sponsor, but they were not involved with this blog post. It’s just a tool we like and think is useful!

semgrep-screenshot.png

Semgrep Python rule example.

5 - Dependabot

Dependabot is part of the suite of GitHub security tools. It analyzes your dependencies and opens pull requests when new versions are released. The PRs include details about what has changed, and if you use GitHub Actions to execute tests, will run them against the changeset. This is useful to quickly patch security issues and stay on top of updated packages.

dependabot-screenshot.png

Dependabot pull request.

6 - Swimm

Swimm is a tool for keeping your documentation up to date as the code changes. It does this by linking the code to the documentation source (in Markdown) and analyzing code changes that would cause the docs to become outdated. Documentation is often separate from the code, but Swimm helps encourage coupling them together in the same code repo.

Disclosure: Swimm is a past Console Newsletter sponsor, but they were not involved with this blog post. It’s just a tool we like and think is useful!

swimm-screenshot.png

Swimm editor screenshot.

7 - Hermit

Hermit isolates development environments and makes it easy to bootstrap new ones with core dependencies like language runtimes preconfigured. This means you can quickly switch between projects that require different versions of the same runtime, such as different Golang or NodeJS versions. This works well for local development, but also ensures that any CI environment is also consistent.

Alternatives: Hermit is similar to asdf or Nix, but is generally easier and faster to work with if it supports the dependencies you need.

image-7.png

Hermit CLI screenshot.

8 - GitPod or GitHub Codespaces

GitPod and GitHub Codespaces both provide isolated development environments in the cloud. These are useful when you need to quickly run through a pull request, or if you want to offload processing from a low-powered laptop. You can even run your IDE in the browser.

I’ve found them useful when a dependency doesn’t work on my M1 Macbook because it’s not available for ARM because these environments are run in x86 cloud environments. You can also  preconfigure the environment so everything is set up correctly.

Using these assumes a low-latency connection to the cloud service, so local development may be better in some cases, but the main advantage is that the cloud environment can pre-build dependencies so that bootstrapping is done before you even need it. Keeping environments isolated between projects and branches avoids the dependency resolution problems that Hermit or asdf try to solve.

github-codespaces-screenshot.png

Screenshot of GitHub Codespaces in the browser.

9 - Snaplet

Once you have a production database, Snaplet helps create copies that you can use for development. It solves the problems of needing to develop against realistic data, or when debugging a tricky user-specific problem. Developers no longer need to connect directly to the production database and it avoids wasting time dumping databases and sanitizing data for development.

Disclosure: Console is an investor in Snaplet.

snaplet-screenshot.png

Snaplet snapshot screenshot.

What about ...?

After these there's a lot more that needs to be done, and lots of tools to help you out. Check out all our recent reviews across all devtools categories.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK