Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ The `forehead.toml` file defines project metadata, header templates, path-based
- `indicators` — extra keywords on top of built-in defaults (`Copyright`, `SPDX`, `License`) for header detection. Set to `["none"]` to disable all built-in defaults.
- `greetings` — optional line prepended to every header. Supports template placeholders.

### Top-level `ignore` field

- `ignore` — list of file/dir names or relative path suffixes to exclude from processing, e.g. `ignore = ["vendor", "generated.rs"]`. Defaults to `[]`.
- The legacy key name `skip` is still accepted as an alias for backward compatibility.
- TOML files are always ignored by default; `Cargo.toml` is still processed for its `license` field.
- Applying headers is idempotent — stale license headers found anywhere in a file are replaced, never duplicated.

## Invariants

- All source files must have a correct license header
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
]

[workspace.package]
version = "0.2.1"
version = "0.2.2"
edition = "2021"
license = "Apache-2.0 OR MIT"
authors = ["Afsall Inc"]
Expand Down
37 changes: 0 additions & 37 deletions changelogger.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
# بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم
# This file is part of forehead.
#
# Copyright (C) 2026-Present Afsall Inc.
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Alternatively, this file is available under the MIT License:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

version = 1
schema = "prdoc/schema_user.json"
output_dir = "prdoc"
Expand Down
39 changes: 1 addition & 38 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
# بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم
# This file is part of forehead.
#
# Copyright (C) 2026-Present Afsall Inc.
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Alternatively, this file is available under the MIT License:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

[tools]
rust = "1.84"

Expand All @@ -57,4 +20,4 @@ depends = ["fmt", "headers", "clippy", "test", "build"]

[tasks.changelogger]
description = "Install changelogger-cli v0.2.2"
run = "cargo install changelogger-cli --version 0.2.2"
run = "cargo install changelogger-cli --version 0.2.2"
2 changes: 1 addition & 1 deletion packages/forehead-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description.workspace = true
readme = "README.md"

[dependencies]
forehead-core = { path = "../forehead-core", version = "0.2.1" }
forehead-core = { path = "../forehead-core", version = "0.2.2" }
clap.workspace = true
anyhow.workspace = true
serde.workspace = true
Expand Down
4 changes: 4 additions & 0 deletions packages/forehead-cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ template = "mit-apache"
# Optional line prepended to every header. Supports template placeholders.
# greetings = "بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم"

# Directories or files to exclude by name or relative path suffix.
# TOML files are always ignored by default (Cargo.toml is still synced).
# ignore = ["vendor", "generated.rs"]

[file_types]
"#;

Expand Down
3 changes: 3 additions & 0 deletions packages/forehead-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ let report = forehead.remove(false)?;
- Template placeholders: `{project}`, `{author}`, `{year}`, `{year_span}`, `{license}`, `{repository}`, `{description}`, `{file}`
- Optional greetings line prepended to every header
- Headless detection, apply, check, and remove operations
- `ignore` list to exclude files/directories by name or path suffix
- TOML files skipped by default (Cargo.toml still gets its `license` field synced)
- Idempotent header application — stale license headers are replaced, never duplicated

## License

Expand Down
7 changes: 2 additions & 5 deletions packages/forehead-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ pub struct Config {
#[serde(default)]
pub file_types: HashMap<String, FileTypeConfig>,

#[serde(default)]
pub skip: Vec<String>,

#[serde(default)]
pub include: Vec<String>,
#[serde(default, alias = "skip")]
pub ignore: Vec<String>,
}

#[derive(Debug, Clone, Default, Deserialize)]
Expand Down
Loading
Loading