Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/checkout-4
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Oct 14, 2023
2 parents eeaf21c + 90e98e0 commit bf1c5b2
Show file tree
Hide file tree
Showing 18 changed files with 1,427 additions and 248 deletions.
6 changes: 3 additions & 3 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ branches:
# Required. Require branches to be up to date before merging.
strict: true
# Required. The list of status checks to require in order to merge into this branch
contexts: [ "bors" ]
contexts: [ ]
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins: false
# Disabled for bors to work
# Disabled for mergify to work
required_linear_history: false
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
restrictions:
apps: [ "bors" ]
apps: [ "mergify" ]
users: []
teams: []
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
os:
- macos-latest
- ubuntu-20.04
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
os:
- macos-latest
- ubuntu-20.04
- ubuntu-latest
- windows-2019
runs-on: ${{ matrix.os }}
steps:
Expand Down
26 changes: 26 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
queue_rules:
- name: default
merge_conditions:
- check-success=Evaluate flake.nix
- check-success=build (macos-latest)
- check-success=build (ubuntu-latest)
- check-success=build_and_test (macos-latest)
- check-success=build_and_test (ubuntu-latest)
- check-success=build_and_test (windows-2019)
- check-success=clippy_check
- check-success=devShell default [x86_64-linux]
- check-success=gh-pages
- check-success=package default [x86_64-linux]
- check-success=package docs [x86_64-linux]
defaults:
actions:
queue:
allow_merging_configuration_change: true
method: rebase
pull_request_rules:
- name: merge using the merge queue
conditions:
- base=main
- label~=merge-queue|dependencies
actions:
queue: {}
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@

0.6.0 / 2023-09-28
==================

* docs: better formatter-spec structure, lots of fixes everywhere
* docs: use mkdocs-numtide (#227)
* feat: clap integration (#214)
* feat: improve the formatter load error (#211)
* feat: more concise stats (#190)
* feat: replace custom log with env_logger (#199)
* feat: update rust to 1.65.0 (#193)
* fix: Don't ignore --config-file when using --stdin (#231)
* fix: change default log level to info (#212)
* fix: default log level should be 'Warn' not 'Off' (#207)
* fix: log formatter error as warn instead of info (#207)
* fix: minor typos (#248)
* fix: stop symlinked tree root being deref'd (#252)
* fix: treefmt --stdin when changes are moved into tempfile (#225)
* flake: expose the list of supported systems (#228)
* flake: make treefmt the default package
* flake: move treefmt.withConfig to a separate repo (#204)
* repo: switch default branch to main

0.5.0 / 2022-12-01
==================

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "treefmt"
version = "0.5.0"
version = "0.6.0"
edition = "2018"
description = "one CLI to format your repo"
license = "MIT"
Expand Down
14 changes: 0 additions & 14 deletions bors.toml

This file was deleted.

1 change: 1 addition & 0 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -exuo pipefail

# Quick sanity check
cargo test
cargo test -- --ignored --test-threads=1

# Check that no code needs reformatting. Acts as a minimal integration test.
cargo run -- --fail-on-change
Expand Down
6 changes: 5 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
let
lib = nixpkgs.lib;

# Override license so that we can build zerotierone without
# having to re-import nixpkgs.
terraform' = nixpkgs.terraform.overrideAttrs (old: { meta = { }; });

rustVersionExtended = rustVersion.override {
# include source for IDE's and other tools that resolve the source automatically via
# $(rustc --print sysroot)/lib/rustlib/src/rust
Expand Down Expand Up @@ -85,7 +89,7 @@ let
rufo
shellcheck
shfmt
terraform
terraform'

# Docs
mkdocs-numtide
Expand Down
4 changes: 2 additions & 2 deletions docs/treefmt-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

`treefmt` can only be run in the presence of `treefmt.toml` where files are mapped to specific code formatters.

Usually the config file sits in the project root folder. If you're running `treefmt` in one of the project's folders, then `treefmt` will look for the config in the parent folders up until the project's root. However, you can place the config anywhere in your project's file tree and specify the path in the the ---config-file flag.
Usually the config file sits in the project root folder. If you're running `treefmt` in one of the project's folders, then `treefmt` will look for the config in the parent folders up until the project's root. However, you can place the config anywhere in your project's file tree and specify the path in the ---config-file flag.

The typical section of `treefmt.toml` looks like this:

```
[formatter.<name>]
command = "<formatter-command>"
options = ["<formatter-option-1>"...]
includes = ["<regular-expression>"]
includes = ["<glob-pattern>"...]
```

...where name is just an identifier.
Expand Down
2 changes: 1 addition & 1 deletion examples/html/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
56 changes: 37 additions & 19 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 32 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,37 @@
inputs.mkdocs-numtide.inputs.nixpkgs.follows = "nixpkgs";

outputs = { self, nixpkgs, flake-parts, mkdocs-numtide, systems, ... }@inputs:
flake-parts.lib.mkFlake { inherit self; } {
systems = import systems;
perSystem = { system, pkgs, ... }:
let
packages = import ./. {
inherit system;
mkdocs-numtide = mkdocs-numtide.packages.${system}.default;
(flake-parts.lib.evalFlakeModule
{ inherit inputs; }
{
systems = import systems;
perSystem = { system, self', lib, pkgs, ... }:
let
packages = import ./. {
inherit system;
mkdocs-numtide = mkdocs-numtide.packages.${system}.default;
};
in
{
# This contains a mix of packages, modules, ...
legacyPackages = packages;

# Allow `nix run github:numtide/treefmt`.
packages.default = packages.treefmt;

packages.docs = mkdocs-numtide.lib.${system}.mkDocs {
name = "treefmt-docs";
src = ./.;
};

checks =
let
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
in
packages // devShells;

devShells.default = packages.devShell;
};
in
{
# This contains a mix of packages, modules, ...
legacyPackages = packages;

# Allow `nix run github:numtide/treefmt`.
packages.default = packages.treefmt;

packages.docs = mkdocs-numtide.lib.${system}.mkDocs {
name = "treefmt-docs";
src = ./.;
};

devShells.default = packages.devShell;
};
};
}).config.flake;
}
Loading

0 comments on commit bf1c5b2

Please sign in to comment.