diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index bc661efaee..6a9dbc3714 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -1,8 +1,14 @@ -#!/bin/bash +#!/bin/sh -FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs") -if [ -n "$FILES" ] -then - dotnet format ./bitwarden-server.sln --no-restore --include $FILES - echo "$FILES" | xargs git add +FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') +[ -z "$FILES" ] && exit 0 + +if npx mega-linter-runner --containername "megalinter-incremental" \ + --flavor formatters --remove-container --fix --env "'APPLY_FIXES=all'" \ + --env "'CLEAR_REPORT_FOLDER=true'" --env "'LOG_LEVEL=warning'" \ + --filesonly $FILES; then + echo "$FILES" | xargs git add + exit 0 fi + +exit 1 diff --git a/.gitignore b/.gitignore index 65157bf4aa..ae49506f35 100644 --- a/.gitignore +++ b/.gitignore @@ -196,6 +196,9 @@ FakesAssemblies/ # Visual Studio 6 workspace options file *.opt +# Lint +megalinter-reports/ + # Other project.lock.json *.jfm diff --git a/README.md b/README.md index c817931c67..9a0f4bfb2a 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,15 @@ The Bitwarden Server project contains the APIs, database, and other core infrast The server project is written in C# using .NET Core with ASP.NET Core. The database is written in T-SQL/SQL Server. The codebase can be developed, built, run, and deployed cross-platform on Windows, macOS, and Linux distributions. -## Developer Documentation +# Contributing -Please refer to the [Server Setup Guide](https://contributing.bitwarden.com/getting-started/server/guide) in the [Contributing Documentation](https://contributing.bitwarden.com/) for build instructions, recommended tooling, code style tips, and lots of other great information to get you started. +Code contributions are welcome! Please commit any pull requests against the `main` branch. Learn more about how to contribute by reading the [Contributing Guidelines](https://contributing.bitwarden.com/contributing/). Check out the [Contributing Documentation](https://contributing.bitwarden.com/) for how to get started with your first contribution. -## Deploy +Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the [`SECURITY.md`](SECURITY.md) file. We also run a program on [HackerOne](https://hackerone.com/bitwarden). + +No grant of any rights in the trademarks, service marks, or logos of Bitwarden is made (except as may be necessary to comply with the notice requirements as applicable), and use of any Bitwarden trademarks must comply with [Bitwarden Trademark Guidelines](https://github.com/bitwarden/server/blob/main/TRADEMARK_GUIDELINES.md). + +# Deploying