Remove duplicate line at the end of files

This commit is contained in:
nicolargo 2025-09-28 16:28:05 +02:00
parent c970932e96
commit 0bf79775b6
6 changed files with 12 additions and 4 deletions

View File

@ -138,6 +138,9 @@ test-export: test-export-csv test-export-json test-export-influxdb-v1 test-expor
# Linters, profilers and cyber security
# ===================================================================
find-duplicate-lines:
sh ./tests-data/tools/find-duplicate-lines.sh
format: ## Format the code
$(venv_full)/python -m ruff format .

View File

@ -188,4 +188,3 @@ def main():
# Glances can be ran in standalone, client or server mode
start(config=core.get_config(), args=core.get_args())
start(config=core.get_config(), args=core.get_args())

View File

@ -365,4 +365,3 @@ class Config:
return self.parser.getboolean(section, option)
except (NoOptionError, NoSectionError):
return bool(default)
return bool(default)

View File

@ -320,4 +320,3 @@ class QuicklookPlugin(GlancesPluginModel):
def _mhz_to_hz(self, hz):
"""Convert Mhz to Hz."""
return hz * 1000000.0
return hz * 1000000.0

View File

@ -419,4 +419,3 @@ please rename it to "{plugin_path.capitalize()}Plugin"'
# Close plugins
for p in self._plugins:
self._plugins[p].exit()
self._plugins[p].exit()

View File

@ -0,0 +1,9 @@
find ./glances/ -type f -name "*.py" -exec sh -c '
for file; do
last_line=$(tail -n 1 "$file")
second_last_line=$(tail -n 2 "$file" | head -n 1)
if [ -n "$last_line" ] && [ -n "$second_last_line" ] && [ "$last_line" = "$second_last_line" ]; then
echo "Duplicate last line in: $file"
fi
done
' sh {} +