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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Initialize and update submodules:
git submodule update --init --recursive
```

## Adding files
Certain file types need to be added to our linting rules manually:

* **YAML**. If adding a YAML file (regardless of its extension), add it as an argument to the
`yamllint` command in [lint-tasks.yaml](lint-tasks.yaml).

## Linting
Before submitting a pull request, ensure you’ve run the linting commands below and either fixed any
violations or suppressed the warning.
Expand Down
9 changes: 8 additions & 1 deletion lint-tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ tasks:
cmds:
- |-
. "{{.G_LINT_VENV_DIR}}/bin/activate"
yamllint --strict .
yamllint \
--config-file "tools/yscope-dev-utils/lint-configs/.yamllint.yml" \
--strict \
.gersemirc \
.github/ \
.yamllint.yaml \
lint-tasks.yaml \
taskfile.yaml
Comment on lines +39 to +46

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Configuration file is missing and YAML coverage needs adjustment

The verification revealed two critical issues:

  • The specified configuration file at tools/yscope-dev-utils/lint-configs/.yamllint.yml does not exist
  • The current linting command includes paths that don't exist in the repository:
    • .gersemirc is not found
    • .yamllint.yaml is not found
    • The only YAML files present are taskfile.yaml and lint-tasks.yaml

Please:

  1. Create the missing configuration file at the specified path or update the path to the correct location
  2. Update the yamllint command to include only existing files:
yamllint \
  --config-file "tools/yscope-dev-utils/lint-configs/.yamllint.yml" \
  --strict \
  .github/ \
  lint-tasks.yaml \
  taskfile.yaml
🔗 Analysis chain

The approach to use an include list is sound, but let's verify the configuration.

The change from a catch-all approach to an explicit include list is a good practice, especially for repositories with generated YAML files.

Let's verify the configuration and coverage:


The previous script showed that the config file was missing. Let's verify the actual paths and structure to provide accurate feedback about the configuration file location and YAML files that need linting.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify configuration file existence and identify potential missing YAML files

# Test 1: Verify config file exists
echo "Checking for config file..."
if [ ! -f "tools/yscope-dev-utils/lint-configs/.yamllint.yml" ]; then
    echo "Error: Config file not found"
    exit 1
fi

# Test 2: Find all YAML files that might need to be included
echo "Checking for potential missing YAML files..."
fd -e yml -e yaml --exclude build --exclude tools/yscope-dev-utils/lint-configs/.yamllint.yml \
  --exec echo "Found YAML file: {}"

Length of output: 207


Script:

#!/bin/bash
# Let's verify the actual path structure and find YAML files
echo "Repository YAML files:"
find . -type f \( -name "*.yml" -o -name "*.yaml" \) -not -path "*/\.*" -not -path "*/build/*"

echo -e "\nRepository structure for tools directory:"
ls -R tools/

Length of output: 351


cmake:
internal: true
Expand Down