1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-07 19:50:32 -05:00

Holistic local linting with Mega-Linter

This commit is contained in:
Matt Bishop 2025-06-07 10:33:24 -04:00
parent 25d5efacd8
commit fe24bc79ce
No known key found for this signature in database
3 changed files with 29 additions and 24 deletions

View File

@ -1,8 +1,14 @@
#!/bin/bash #!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs") FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
if [ -n "$FILES" ] [ -z "$FILES" ] && exit 0
then
dotnet format ./bitwarden-server.sln --no-restore --include $FILES 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 echo "$FILES" | xargs git add
exit 0
fi fi
exit 1

3
.gitignore vendored
View File

@ -196,6 +196,9 @@ FakesAssemblies/
# Visual Studio 6 workspace options file # Visual Studio 6 workspace options file
*.opt *.opt
# Lint
megalinter-reports/
# Other # Other
project.lock.json project.lock.json
*.jfm *.jfm

View File

@ -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. 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
<p align="center"> <p align="center">
<a href="https://github.com/orgs/bitwarden/packages" target="_blank"> <a href="https://github.com/orgs/bitwarden/packages" target="_blank">
@ -30,9 +34,9 @@ Please refer to the [Server Setup Guide](https://contributing.bitwarden.com/gett
You can deploy Bitwarden using Docker containers on Windows, macOS, and Linux distributions. Use the provided PowerShell and Bash scripts to get started quickly. Find all of the Bitwarden images on [GitHub Container Registry](https://github.com/orgs/bitwarden/packages). You can deploy Bitwarden using Docker containers on Windows, macOS, and Linux distributions. Use the provided PowerShell and Bash scripts to get started quickly. Find all of the Bitwarden images on [GitHub Container Registry](https://github.com/orgs/bitwarden/packages).
Full documentation for deploying Bitwarden with Docker can be found in our help center at: https://help.bitwarden.com/article/install-on-premise/ Full documentation for deploying Bitwarden with Docker can be found in our help center at: <https://help.bitwarden.com/article/install-on-premise/>
### Requirements ## Requirements
- [Docker](https://www.docker.com/community-edition#/download) - [Docker](https://www.docker.com/community-edition#/download)
- [Docker Compose](https://docs.docker.com/compose/install/) (already included with some Docker installations) - [Docker Compose](https://docs.docker.com/compose/install/) (already included with some Docker installations)
@ -58,22 +62,14 @@ Invoke-RestMethod -OutFile bitwarden.ps1 `
.\bitwarden.ps1 -start .\bitwarden.ps1 -start
``` ```
## We're Hiring! # Developers
Interested in contributing in a big way? Consider joining our team! We're hiring for many positions. Please take a look at our [Careers page](https://bitwarden.com/careers/) to see what opportunities are currently open as well as what it's like to work at Bitwarden. 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.
## Contribute ## Hooks
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. To gain enhanced functionality such as local linting, install the hooks for this repository:
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).
### Dotnet-format
Consider installing our git pre-commit hook for automatic formatting.
```bash ```bash
git config --local core.hooksPath .git-hooks git config core.hooksPath .git-hooks
``` ```