Skip to content

Commit

Permalink
Bug 1648118: Change the fmt- and lint- make commands for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinYing-Li committed Mar 1, 2021
1 parent 6cb1558 commit 31034fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
7 changes: 3 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ jobs:
steps:
- checkout
- run: sudo pip install yamllint
- run: make yamllint
- run: make lint-yaml

###########################################################################
# Rust / C / FFI
Expand Down Expand Up @@ -440,8 +440,7 @@ jobs:
- image: circleci/android:api-28-ndk
steps:
- checkout
- run: ./gradlew --no-daemon lint
- run: ./gradlew --no-daemon ktlint
- run: ./gradlew --no-daemon lint-kt
- run: ./gradlew --no-daemon detekt

Android tests:
Expand Down Expand Up @@ -725,7 +724,7 @@ jobs:
- checkout
- run:
name: Python lints
command: make pythonlint
command: make lint-python

Python 3_6 tests:
docker:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Introduce a new API `Ping#test_before_next_submit` to run a callback right before a custom ping is submitted ([#1507](https://github.com/mozilla/glean/pull/1507)).
* The new API exists for all language bindings (Kotlin, Swift, Rust, Python).
* Updated `glean_parser` version to 2.5.0
* Change the `fmt-` and `lint-` make commands for consistency ([#]())
* Python
* Update minimal required version of `cffi` dependency to 1.13.0 ([#1520](https://github.com/mozilla/glean/pull/1520)).
* RLB
Expand Down
22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,42 +92,38 @@ bench-rust: ## Run Rust benchmarks

# Linting

lint: clippy

clippy: ## Run cargo-clippy to lint Rust code
lint-rust: ## Run cargo-clippy to lint Rust code
cargo clippy --all --all-targets --all-features -- -D warnings

ktlint: ## Run ktlint to lint Kotlin code
lint-kt: ## Run ktlint to lint Kotlin code
./gradlew ktlint detekt

swiftlint: ## Run swiftlint to lint Swift code
lint-swift: ## Run swiftlint to lint Swift code
swiftlint --strict

yamllint: ## Run yamllint to lint YAML files
lint-yaml: ## Run yamllint to lint YAML files
yamllint glean-core .circleci

shellcheck: ## Run shellcheck against important shell scripts
shellcheck glean-core/ios/sdk_generator.sh
shellcheck bin/check-artifact.sh

pythonlint: python-setup ## Run flake8 and black to lint Python code
lint-python: python-setup ## Run flake8 and black to lint Python code
$(GLEAN_PYENV)/bin/python3 -m flake8 glean-core/python/glean glean-core/python/tests
$(GLEAN_PYENV)/bin/python3 -m black --check --exclude \(.venv\*\)\|\(.eggs\) glean-core/python
$(GLEAN_PYENV)/bin/python3 -m mypy glean-core/python/glean

.PHONY: lint clippy ktlint swiftlint yamllint
.PHONY: lint-rust lint-kt lint-swift lint-yaml

# Formatting

fmt: rustfmt

rustfmt: ## Format all Rust code
fmt-rust: ## Format all Rust code
cargo fmt --all

pythonfmt: python-setup ## Run black to format Python code
fmt-python: python-setup ## Run black to format Python code
$(GLEAN_PYENV)/bin/python3 -m black glean-core/python/glean glean-core/python/tests

.PHONY: fmt rustfmt
.PHONY: fmt-rust

# Docs

Expand Down

0 comments on commit 31034fc

Please sign in to comment.